diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2013-03-04 07:31:57 -0800 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2013-03-04 07:36:22 -0800 |
commit | e1317c149c7703b51d2e5d62c4d5891d99e57421 (patch) | |
tree | 12ddf072430ef4bcf5e0baaf013379fb7b0984e0 | |
parent | 748618d6e39c3bce5f8f697a90cd35ffe3c14206 (diff) |
wrappercheck.sh: more resilient against race conditions
Killing the helper shell may fail when the shell already quit.
-rwxr-xr-x | test/wrappercheck.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/wrappercheck.sh b/test/wrappercheck.sh index dd7132c6..6c3eff75 100755 --- a/test/wrappercheck.sh +++ b/test/wrappercheck.sh @@ -60,8 +60,14 @@ kill -INT $BACKGROUND_PID && kill -TERM $BACKGROUND_PID || true KILL_PID=$! set +e wait $BACKGROUND_PID -kill -KILL $KILL_PID +msg=$(kill -KILL $KILL_PID 2>&1) SUBRET=$? +if echo "$msg" | grep -q 'No such process'; then + # Consider this a success. + SUBRET=0 +else + echo "$msg" +fi set -e if [ $RET = 0 ]; then RET=$SUBRET |