summaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-03 18:23:42 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-03 18:23:42 +0000
commitfc2eddad05c373085a2dc239b1cce5e0548c02a8 (patch)
tree217bdda7b9a43a3b92b3abcc8ca2c7ac3dc08c17 /libgo
parent7dcad7644af8b659eb769589c4cfc583e34a47ef (diff)
downloadgcc-fc2eddad05c373085a2dc239b1cce5e0548c02a8.tar.gz
libgo/testsuite: kill sleep process in gotest
This change modifies the "gotest" shell script to kill all processes, including "sleep", spawned by the timeout subshell. This prevents the sleep process from living beyond the gotest process. BACKGROUND The "gotest" shell script spawns "sleep" processes in the background to kill off test cases that run past their specified timeout. There are commands included that appear to kill the sleep process, but they only kill the parent shell, causing the sleep process to reparent. The orphaned sleep process can cause issues when gotest is run under some build systems, such as Ninja [0]. The particular issue with Ninja is the method it uses to identify terminated processes: it creates a pipe, passes the write end to the child process, and waits for EOF. In the case of libgo/gotest, the orphaned sleep process inherits the pipe FD and keeps it open for 4 minutes by default. [0] https://github.com/martine/ninja Reviewed-on: https://go-review.googlesource.com/12227 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226526 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rwxr-xr-xlibgo/testsuite/gotest2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
index 3596d727ff1..7d5e99f4987 100755
--- a/libgo/testsuite/gotest
+++ b/libgo/testsuite/gotest
@@ -518,7 +518,7 @@ xno)
wait $pid
status=$?
if ! test -f gotest-timeout; then
- kill $alarmpid
+ ps -o pid,ppid | grep " $alarmpid" | cut -f1 -d" " | xargs kill -9
fi
else
if test "$trace" = "true"; then