Skip to content

Commit

Permalink
examples: change wait into job polling loop after killing tests (#3168)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfawley authored Nov 8, 2019
1 parent d903dd7 commit 95c3759
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions examples/examples_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,18 @@ export TMPDIR=$(mktemp -d)
trap "rm -rf ${TMPDIR}" EXIT

clean () {
jobs -p | xargs pkill -P
wait
for i in {1..10}; do
jobs -p | xargs -n1 pkill -P
# A simple "wait" just hangs sometimes. Running `jobs` seems to help.
sleep 1
if jobs | read; then
return
fi
done
echo "$(tput setaf 1) clean failed to kill tests $(tput sgr 0)"
jobs
pstree
exit 1
}

fail () {
Expand Down

0 comments on commit 95c3759

Please sign in to comment.