mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-22 22:17:54 +00:00
fc0c6cee08
Passes testsuite.
185 lines
8.7 KiB
Plaintext
185 lines
8.7 KiB
Plaintext
echo '### bug #42089: --results with arg > 256 chars (should be 1 char shorter)'
|
|
### bug #42089: --results with arg > 256 chars (should be 1 char shorter)
|
|
parallel --results parallel_test_dir echo ::: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456; ls parallel_test_dir/1/
|
|
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456
|
|
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345
|
|
rm -rf parallel_test_dir
|
|
echo '**'
|
|
**
|
|
echo '### Test --halt-on-error 0'; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true") | parallel -j10 --halt-on-error 0; echo $?; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true";echo "sleep 4; non_exist") | parallel -j10 --halt 0; echo $?
|
|
### Test --halt-on-error 0
|
|
1
|
|
2
|
|
/bin/bash: non_exist: command not found
|
|
echo '**'
|
|
**
|
|
echo '### Test --halt-on-error 1'; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true") | parallel -j10 --halt-on-error 1; echo $?; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true";echo "sleep 4; non_exist") | parallel -j10 --halt 1; echo $?
|
|
### Test --halt-on-error 1
|
|
1
|
|
127
|
|
parallel: This job failed:
|
|
sleep 2;false
|
|
parallel: Starting no more jobs. Waiting for 1 jobs to finish.
|
|
parallel: This job failed:
|
|
sleep 2;false
|
|
parallel: Starting no more jobs. Waiting for 2 jobs to finish.
|
|
/bin/bash: non_exist: command not found
|
|
parallel: This job failed:
|
|
sleep 4; non_exist
|
|
echo '**'
|
|
**
|
|
echo '### Test --halt-on-error 2'; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true") | parallel -j10 --halt-on-error 2; echo $?; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true";echo "sleep 4; non_exist") | parallel -j10 --halt 2; echo $?
|
|
### Test --halt-on-error 2
|
|
1
|
|
1
|
|
parallel: This job failed:
|
|
sleep 2;false
|
|
parallel: This job failed:
|
|
sleep 2;false
|
|
echo '**'
|
|
**
|
|
echo '### Test --halt -1'; (echo "sleep 1;false"; echo "sleep 2;true";echo "sleep 3;false") | parallel -j10 --halt-on-error -1; echo $?; (echo "sleep 1;false"; echo "sleep 2;true";echo "sleep 3;false";echo "sleep 4; non_exist") | parallel -j10 --halt -1; echo $?
|
|
### Test --halt -1
|
|
0
|
|
0
|
|
parallel: This job succeeded:
|
|
sleep 2;true
|
|
parallel: Starting no more jobs. Waiting for 1 jobs to finish.
|
|
parallel: This job succeeded:
|
|
sleep 2;true
|
|
parallel: Starting no more jobs. Waiting for 2 jobs to finish.
|
|
/bin/bash: non_exist: command not found
|
|
echo '**'
|
|
**
|
|
echo '### Test --halt -2'; (echo "sleep 1;false"; echo "sleep 2;true";echo "sleep 3;false") | parallel -j10 --halt-on-error -2; echo $?; (echo "sleep 1;false"; echo "sleep 2;true";echo "sleep 3;false";echo "sleep 4; non_exist") | parallel -j10 --halt -2; echo $?
|
|
### Test --halt -2
|
|
0
|
|
0
|
|
parallel: This job succeeded:
|
|
sleep 2;true
|
|
parallel: This job succeeded:
|
|
sleep 2;true
|
|
echo '**'
|
|
**
|
|
echo '### Test last dying print --halt-on-error 1'; (seq 0 8;echo 0; echo 9) | parallel -j10 -kq --halt 1 perl -e 'sleep $ARGV[0];print STDERR @ARGV,"\n"; exit shift'; echo exit code $?
|
|
### Test last dying print --halt-on-error 1
|
|
exit code 9
|
|
0
|
|
1
|
|
parallel: This job failed:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 1
|
|
parallel: Starting no more jobs. Waiting for 8 jobs to finish.
|
|
2
|
|
parallel: This job failed:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 2
|
|
parallel: Starting no more jobs. Waiting for 7 jobs to finish.
|
|
3
|
|
parallel: This job failed:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 3
|
|
parallel: Starting no more jobs. Waiting for 6 jobs to finish.
|
|
4
|
|
parallel: This job failed:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 4
|
|
parallel: Starting no more jobs. Waiting for 5 jobs to finish.
|
|
5
|
|
parallel: This job failed:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 5
|
|
parallel: Starting no more jobs. Waiting for 4 jobs to finish.
|
|
6
|
|
parallel: This job failed:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 6
|
|
parallel: Starting no more jobs. Waiting for 3 jobs to finish.
|
|
7
|
|
parallel: This job failed:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 7
|
|
parallel: Starting no more jobs. Waiting for 2 jobs to finish.
|
|
8
|
|
0
|
|
parallel: This job failed:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 8
|
|
parallel: Starting no more jobs. Waiting for 1 jobs to finish.
|
|
9
|
|
parallel: This job failed:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 9
|
|
echo '### Test last dying print --halt-on-error 2'; (seq 0 8;echo 0; echo 9) | parallel -j10 -kq --halt 2 perl -e 'sleep $ARGV[0];print STDERR @ARGV,"\n"; exit shift'; echo exit code $?
|
|
### Test last dying print --halt-on-error 2
|
|
exit code 1
|
|
0
|
|
1
|
|
parallel: This job failed:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 1
|
|
echo '### Test last dying print --halt-on-error -1'; (seq 0 8;echo 0; echo 9) | parallel -j10 -kq --halt -1 perl -e 'sleep $ARGV[0];print STDERR @ARGV,"\n"; exit not shift'; echo exit code $?
|
|
### Test last dying print --halt-on-error -1
|
|
exit code 0
|
|
0
|
|
1
|
|
parallel: This job succeeded:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 1
|
|
parallel: Starting no more jobs. Waiting for 8 jobs to finish.
|
|
2
|
|
parallel: This job succeeded:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 2
|
|
parallel: Starting no more jobs. Waiting for 7 jobs to finish.
|
|
3
|
|
parallel: This job succeeded:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 3
|
|
parallel: Starting no more jobs. Waiting for 6 jobs to finish.
|
|
4
|
|
parallel: This job succeeded:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 4
|
|
parallel: Starting no more jobs. Waiting for 5 jobs to finish.
|
|
5
|
|
parallel: This job succeeded:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 5
|
|
parallel: Starting no more jobs. Waiting for 4 jobs to finish.
|
|
6
|
|
parallel: This job succeeded:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 6
|
|
parallel: Starting no more jobs. Waiting for 3 jobs to finish.
|
|
7
|
|
parallel: This job succeeded:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 7
|
|
parallel: Starting no more jobs. Waiting for 2 jobs to finish.
|
|
8
|
|
0
|
|
parallel: This job succeeded:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 8
|
|
parallel: Starting no more jobs. Waiting for 1 jobs to finish.
|
|
9
|
|
parallel: This job succeeded:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 9
|
|
echo '### Test last dying print --halt-on-error -2'; (seq 0 8;echo 0; echo 9) | parallel -j10 -kq --halt -2 perl -e 'sleep $ARGV[0];print STDERR @ARGV,"\n"; exit not shift'; echo exit code $?
|
|
### Test last dying print --halt-on-error -2
|
|
exit code 0
|
|
0
|
|
1
|
|
parallel: This job succeeded:
|
|
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 1
|
|
echo '**'
|
|
**
|
|
echo '### Test slow arguments generation - https://savannah.gnu.org/bugs/?32834'; seq 1 3 | parallel -j1 "sleep 2; echo {}" | parallel -kj2 echo
|
|
### Test slow arguments generation - https://savannah.gnu.org/bugs/?32834
|
|
1
|
|
2
|
|
3
|
|
echo '**'
|
|
**
|
|
echo '### Are children killed if GNU Parallel receives TERM twice? There should be no sleep at the end'
|
|
### Are children killed if GNU Parallel receives TERM twice? There should be no sleep at the end
|
|
parallel -q bash -c 'sleep 120 & pid=$!; wait $pid' ::: 1 & T=$!; sleep 1; pstree $$; kill -TERM $T; sleep 1; pstree $$; kill -TERM $T; sleep 1; pstree $$; echo '**'
|
|
bash-+-perl---bash---sleep
|
|
`-pstree
|
|
bash-+-perl---bash---sleep
|
|
`-pstree
|
|
bash---pstree
|
|
**
|
|
parallel: SIGTERM received. No new jobs will be started.
|
|
parallel: Waiting for these 1 jobs to finish. Send SIGTERM again to stop now.
|
|
parallel: bash -c sleep\ 120\ \&\ pid=\$\!\;\ wait\ \$pid 1
|
|
echo '### Are children killed if GNU Parallel receives INT twice? There should be no sleep at the end'
|
|
### Are children killed if GNU Parallel receives INT twice? There should be no sleep at the end
|
|
parallel -q bash -c 'sleep 120 & pid=$!; wait $pid' ::: 1 & T=$!; sleep 1; pstree $$; kill -INT $T; sleep 1; pstree $$;
|
|
bash-+-perl---bash---sleep
|
|
`-pstree
|
|
bash---pstree
|