The current detach test code does:
set -e
...
cleanup() {
set +e
kill ...
wait ...
}
...
cleanup
exit 0
The problem is that while `set -e` is disabled for the body of the
cleanup function, it isn't necessarily disabled in the caller scope.
So if the return value of the cleanup function (`wait` in this case)
is non-zero, the script ends up failing overall.
Add an explicit return 0 to the cleanup function so that we don't kill
the overall test pipeline.
* tests/detach-running.test (cleanup): Add return 0.
* tests/detach-sleeping.test (cleanup): Likewise.
* tests/detach-stopped.test (cleanup): Likewise.
set +e
kill $tracee_pid
wait $tracee_pid 2> /dev/null
+ return 0
}
rm -f $LOG
set +e
kill $tracee_pid
wait $tracee_pid 2> /dev/null
+ return 0
}
rm -f $LOG
kill $tracee_pid
kill -CONT $tracee_pid
wait $tracee_pid 2> /dev/null
+ return 0
}
rm -f $LOG