Skip to content

Commit

Permalink
libgo/testsuite: another fix for killing the sleep process
Browse files Browse the repository at this point in the history
Avoid ps padding issues.  Make sure we locate and kill just the sleep
process.

Change-Id: Ib92d7e1afafadd8492e6e7bd733fe96013abc214
Reviewed-on: https://go-review.googlesource.com/13634
Reviewed-by: Andrew Wilkins <axwalk@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
  • Loading branch information
ianlancetaylor committed Aug 20, 2015
1 parent 448d30b commit ec34cfb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libgo/testsuite/gotest
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ xno)
fi
${GL} *.o ${GOLIBS}

set +e
if test "$bench" = ""; then
if test "$trace" = "true"; then
echo ./a.out -test.short -test.timeout=${timeout}s "$@"
Expand All @@ -518,9 +519,11 @@ xno)
wait $pid
status=$?
if ! test -f gotest-timeout; then
out=`ps -o pid,ppid | grep " $alarmpid" | cut -f1 -d" "`
if test "x$out" != "x"; then
kill -9 $out
sleeppid=`ps -o pid,ppid,cmd | grep " $alarmpid " | grep sleep | sed -e 's/ *\([0-9]*\) .*$/\1/'`
kill $alarmpid
wait $alarmpid
if test "$sleeppid" != ""; then
kill $sleeppid
fi
fi
else
Expand Down

0 comments on commit ec34cfb

Please sign in to comment.