mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-21 21:47:54 +00:00
parallel --halt soon,fail=100% </dev/null should not give division by zero.
This commit is contained in:
parent
f9ff5717fe
commit
036319dc09
|
@ -216,7 +216,7 @@ sub halt {
|
|||
if($Global::halt_pct) {
|
||||
$Global::halt_exitstatus =
|
||||
::ceil($Global::total_failed /
|
||||
$Global::total_started * 100);
|
||||
($Global::total_started || 1) * 100);
|
||||
} elsif($Global::halt_count) {
|
||||
$Global::halt_exitstatus =
|
||||
::min(undef_as_zero($Global::total_failed),101);
|
||||
|
|
|
@ -886,6 +886,12 @@ par_sem_quote() {
|
|||
sem --fg --quote -v echo
|
||||
}
|
||||
|
||||
par_halt_on_error_division_by_zero() {
|
||||
echo '### --halt-on-error soon,fail=100% with no input should not give division by zero'
|
||||
stdout parallel --halt-on-error soon,fail=100% echo </dev/null
|
||||
echo $?
|
||||
}
|
||||
|
||||
export -f $(compgen -A function | grep par_)
|
||||
compgen -A function | grep par_ | LC_ALL=C sort |
|
||||
parallel --timeout 20 -j6 --tag -k --joblog +/tmp/jl-`basename $0` '{} 2>&1'
|
||||
|
|
|
@ -148,5 +148,5 @@ export -f $(compgen -A function | egrep 'p_|par_')
|
|||
# Tested that -j0 in parallel is fastest (up to 15 jobs)
|
||||
# more than 3 jobs: sqlite locks
|
||||
compgen -A function | grep par_ | LC_ALL=C sort |
|
||||
stdout parallel --timeout 30 -vj50% -k --tag --joblog /tmp/jl-`basename $0` p_wrapper \
|
||||
stdout parallel --timeout 60 -vj50% -k --tag --joblog /tmp/jl-`basename $0` p_wrapper \
|
||||
:::: - ::: \$MYSQL \$PG \$SQLITE
|
||||
|
|
|
@ -1326,6 +1326,8 @@ par_file_ending_in_newline ### Hans found a bug giving unitialized variable
|
|||
par_file_ending_in_newline gzip /tmp/parallel_f1
|
||||
par_file_ending_in_newline gzip '/tmp/parallel_f2
|
||||
par_file_ending_in_newline '
|
||||
par_halt_on_error_division_by_zero ### --halt-on-error soon,fail=100% with no input should not give division by zero
|
||||
par_halt_on_error_division_by_zero 0
|
||||
par_halt_one_job # Halt soon if there is a single job
|
||||
par_halt_one_job should run 0 1 = job 1 2
|
||||
par_halt_one_job 1
|
||||
|
|
Loading…
Reference in a new issue