Skip to content

Commit ec34cfb

Browse files
committedAug 20, 2015
libgo/testsuite: another fix for killing the sleep process
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 <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 448d30b commit ec34cfb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

‎libgo/testsuite/gotest

+6-3
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ xno)
504504
fi
505505
${GL} *.o ${GOLIBS}
506506

507+
set +e
507508
if test "$bench" = ""; then
508509
if test "$trace" = "true"; then
509510
echo ./a.out -test.short -test.timeout=${timeout}s "$@"
@@ -518,9 +519,11 @@ xno)
518519
wait $pid
519520
status=$?
520521
if ! test -f gotest-timeout; then
521-
out=`ps -o pid,ppid | grep " $alarmpid" | cut -f1 -d" "`
522-
if test "x$out" != "x"; then
523-
kill -9 $out
522+
sleeppid=`ps -o pid,ppid,cmd | grep " $alarmpid " | grep sleep | sed -e 's/ *\([0-9]*\) .*$/\1/'`
523+
kill $alarmpid
524+
wait $alarmpid
525+
if test "$sleeppid" != ""; then
526+
kill $sleeppid
524527
fi
525528
fi
526529
else

0 commit comments

Comments
 (0)
Please sign in to comment.