From 637f5391af32549704da25ee8c7f63432ec54ded Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Sun, 11 Dec 2011 00:16:41 +0100 Subject: [PATCH] -S + --timeout did not repect --timeout. --- src/parallel | 3 +++ testsuite/tests-to-run/test30.sh | 6 ++++++ testsuite/wanted-results/test30 | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/src/parallel b/src/parallel index 7046e309..6ddc40a9 100755 --- a/src/parallel +++ b/src/parallel @@ -101,6 +101,7 @@ if($::opt_nonall or $::opt_onall) { ((defined $::opt_g) ? "-g" : ""), ((defined @::opt_v) ? "-vv" : ""), ((defined $::opt_D) ? "-D" : ""), + ((defined $::opt_timeout) ? "--timeout ".$::opt_timeout : ""), ); ::debug("| parallel"); open(PARALLEL,"| $0 $options") || @@ -113,6 +114,8 @@ if($::opt_nonall or $::opt_onall) { shell_quote_scalar($command)." :::: @argfiles\n"; } close PARALLEL; + $Global::exitstatus = $? >> 8; + debug("--onall exitvalue ",$?); if(@::opt_basefile) { cleanup_basefile(); } unlink(@argfiles); wait_and_exit(min(undef_as_zero($Global::exitstatus),254)); diff --git a/testsuite/tests-to-run/test30.sh b/testsuite/tests-to-run/test30.sh index 491e1061..7f255260 100644 --- a/testsuite/tests-to-run/test30.sh +++ b/testsuite/tests-to-run/test30.sh @@ -1,5 +1,7 @@ #!/bin/bash + +cat <<'EOF' | parallel -j0 -k echo '### Test of --eta' seq 1 10 | stdout parallel --eta "sleep 1; echo {}" | wc -l @@ -14,3 +16,7 @@ stdout parallel --progress "sleep 1; echo {}" < /dev/null echo '### bug #34422: parallel -X --eta crashes with div by zero' seq 2 | stdout parallel -X --eta echo + +echo '### --timeout on remote machines' +parallel -j0 --timeout 3 --onall -S .. 'sleep {}; echo {}' ::: 1 6 7 ; echo $? +EOF diff --git a/testsuite/wanted-results/test30 b/testsuite/wanted-results/test30 index 416e214e..71c8c357 100644 --- a/testsuite/wanted-results/test30 +++ b/testsuite/wanted-results/test30 @@ -18,3 +18,7 @@ Computers / CPU cores / Max jobs to run Computers / CPU cores / Max jobs to run 1:local / 2 / 1 +### --timeout on remote machines +1 +1 +2