Skip to content

Commit

Permalink
test: use custom wait for watching/helpers.sh
Browse files Browse the repository at this point in the history
This allows the fs-memo.t test to succeed on Nix. Before the pid of Dune
was being thrown away by a bash bug causing wait to think it was not a
child process and rejecting it. We therefore wait instead for all child
processes.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
  • Loading branch information
Alizter committed Jul 30, 2023
1 parent ddf8344 commit 285a1e7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/blackbox-tests/test-cases/watching/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@ with_timeout () {

stop_dune () {
with_timeout dune shutdown;
wait $DUNE_PID;
# On Linux, we may run into a bash pid aliasing bug that causes wait to
# reject the pid. Therefore we wait for all child processes instead.
if [ "$(uname -s)" = "Linux" ]
then
# wait for all child processes
wait $(jobs -p);
else
# wait for dune to exit
wait $DUNE_PID;
fi
cat .#dune-output;
}

Expand Down

0 comments on commit 285a1e7

Please sign in to comment.