Skip to content

Commit

Permalink
tests/wait-p: Avoid race condition
Browse files Browse the repository at this point in the history
The test case 'trap interrupts wait' expects the last wait built-in to
finish successfully without an interruption by a signal. To make it
surely happen, the trap action should be uninstalled before waiting.
  • Loading branch information
magicant committed Feb 2, 2024
1 parent 6408b96 commit a5bcffa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/wait-p.tst
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ wait
status=$?
echo interrupted=$interrupted $((status > 128))
kill -l $status
trap '' USR1
# Now the job should be still running. Kill it.
kill -s USR2 %
wait
Expand Down

0 comments on commit a5bcffa

Please sign in to comment.