2009-02-18 01:57:38 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2012-12-28 20:30:30 +00:00
|
|
|
# Simple jobs that never fails
|
2013-12-19 01:19:19 +00:00
|
|
|
# Each should be taking 3-10s and be possible to run in parallel
|
2012-12-28 20:30:30 +00:00
|
|
|
# I.e.: No race conditions, no logins
|
2015-04-09 23:20:51 +00:00
|
|
|
cat <<'EOF' | sed -e 's/;$/; /;s/$SERVER1/'$SERVER1'/;s/$SERVER2/'$SERVER2'/' | stdout parallel -vj0 -k --joblog /tmp/jl-`basename $0` -L1
|
2014-04-19 08:11:32 +00:00
|
|
|
echo '### bug #42089: --results with arg > 256 chars (should be 1 char shorter)'
|
|
|
|
parallel --results parallel_test_dir echo ::: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456;
|
|
|
|
ls parallel_test_dir/1/
|
|
|
|
rm -rf parallel_test_dir
|
|
|
|
|
|
|
|
echo '**'
|
|
|
|
|
2011-07-29 11:45:34 +00:00
|
|
|
echo '### Test slow arguments generation - https://savannah.gnu.org/bugs/?32834';
|
|
|
|
seq 1 3 | parallel -j1 "sleep 2; echo {}" | parallel -kj2 echo
|
|
|
|
|
2015-04-09 23:20:51 +00:00
|
|
|
echo '**'
|
|
|
|
|
|
|
|
echo '### 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=$!;
|
2015-07-22 06:28:05 +00:00
|
|
|
sleep 5;
|
2015-04-09 23:20:51 +00:00
|
|
|
pstree $$;
|
|
|
|
kill -TERM $T;
|
|
|
|
sleep 1;
|
|
|
|
pstree $$;
|
|
|
|
kill -TERM $T;
|
|
|
|
sleep 1;
|
2016-01-23 08:54:05 +00:00
|
|
|
pstree $$;
|
2015-04-09 23:20:51 +00:00
|
|
|
|
|
|
|
echo '**'
|
|
|
|
|
|
|
|
echo '### 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=$!;
|
2015-07-22 06:28:05 +00:00
|
|
|
sleep 5;
|
2015-04-09 23:20:51 +00:00
|
|
|
pstree $$;
|
|
|
|
kill -INT $T;
|
|
|
|
sleep 1;
|
2016-01-23 08:54:05 +00:00
|
|
|
pstree $$;
|
|
|
|
|
|
|
|
echo '**'
|
|
|
|
|
|
|
|
echo '### Do children receive --termseq signals'
|
|
|
|
|
|
|
|
show_signals() {
|
|
|
|
perl -e 'for(keys %SIG) { $SIG{$_} = eval "sub { print STDERR \"Got $_\\n\"; }";} while(1){sleep 1}';
|
|
|
|
};
|
|
|
|
export -f show_signals;
|
|
|
|
echo | stdout parallel --termseq TERM,200,TERM,100,TERM,50,KILL,25 -u --timeout 1 show_signals;
|
|
|
|
echo | stdout parallel --termseq INT,200,TERM,100,KILL,25 -u --timeout 1 show_signals;
|
|
|
|
sleep 3;
|
|
|
|
|
2016-04-11 20:19:28 +00:00
|
|
|
echo '**'
|
2016-01-23 08:54:05 +00:00
|
|
|
|
2016-04-11 20:19:28 +00:00
|
|
|
echo '### bug #47644: Wrong slot number replacement when resuming'
|
|
|
|
seq 0 20 | parallel -kj 4 --delay .2 --joblog /tmp/parallel-bug-47558 'sleep 1; echo {%} {=$_==10 and exit =}';
|
|
|
|
seq 0 20 | parallel -kj 4 --resume --delay .2 --joblog /tmp/parallel-bug-47558 'sleep 1; echo {%} {=$_==110 and exit =}'
|
2015-04-09 23:20:51 +00:00
|
|
|
|
2011-07-20 23:58:23 +00:00
|
|
|
EOF
|