aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/testdata
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2021-11-22 14:30:40 -0500
committerBryan C. Mills <bcmills@google.com>2021-11-22 20:34:30 +0000
commit17aa21279965f5d088606639c17aa60208a34b7d (patch)
treea49aeceac95ef10810d2f09418f52e6862452a51 /src/runtime/testdata
parent773f43b35638092f9c0dc56f4a468dce2eb3a8ef (diff)
downloadgo-17aa21279965f5d088606639c17aa60208a34b7d.tar.xz
runtime: in TestSpuriousWakeupsNeverHangSemasleep, wait for the runtime to register handlers
According to https://man7.org/linux/man-pages/man7/signal.7.html, the default behavior of SIGIO is to terminate the program. The Go runtime changes that behavior with its own signal handler, so the program will terminate if we send the signal before the runtime has finished setting up. Fixes #49727 Change-Id: I65db66f5176831c8d7454eebc0138d825c68e100 Reviewed-on: https://go-review.googlesource.com/c/go/+/366255 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/testdata')
-rw-r--r--src/runtime/testdata/testprog/sleep.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/runtime/testdata/testprog/sleep.go b/src/runtime/testdata/testprog/sleep.go
index 86e2f6cfe6..b230e60181 100644
--- a/src/runtime/testdata/testprog/sleep.go
+++ b/src/runtime/testdata/testprog/sleep.go
@@ -4,7 +4,10 @@
package main
-import "time"
+import (
+ "os"
+ "time"
+)
// for golang.org/issue/27250
@@ -13,5 +16,7 @@ func init() {
}
func After1() {
+ os.Stdout.WriteString("ready\n")
+ os.Stdout.Close()
<-time.After(1 * time.Second)
}