aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/testdata
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2017-06-26 16:11:33 -0700
committerIan Lance Taylor <iant@golang.org>2017-06-27 00:34:53 +0000
commit93870aeee980aadf6f67b778734f25419de55a7d (patch)
tree7ec179951c8800dc384c3bf3afbb57e6ea71f7f5 /src/runtime/testdata
parent09899d9b91f56d57104e2b633a3f9849c7f26184 (diff)
downloadgo-93870aeee980aadf6f67b778734f25419de55a7d.tar.xz
runtime: get more info for TestCgoSignalDeadlock failures
Updates #18598 Change-Id: I13c60124714cf9d1537efa0a7dd1e6a0fed9ae5b Reviewed-on: https://go-review.googlesource.com/46723 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/testdata')
-rw-r--r--src/runtime/testdata/testprogcgo/cgo.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/runtime/testdata/testprogcgo/cgo.go b/src/runtime/testdata/testprogcgo/cgo.go
index 870d4efdea..209524a24d 100644
--- a/src/runtime/testdata/testprogcgo/cgo.go
+++ b/src/runtime/testdata/testprogcgo/cgo.go
@@ -45,10 +45,13 @@ func CgoSignalDeadlock() {
}()
var s *string
*s = ""
+ fmt.Printf("continued after expected panic\n")
}()
}
}()
time.Sleep(time.Millisecond)
+ start := time.Now()
+ var times []time.Duration
for i := 0; i < 64; i++ {
go func() {
runtime.LockOSThread()
@@ -62,8 +65,9 @@ func CgoSignalDeadlock() {
ping <- false
select {
case <-ping:
+ times = append(times, time.Since(start))
case <-time.After(time.Second):
- fmt.Printf("HANG\n")
+ fmt.Printf("HANG 1 %v\n", times)
return
}
}
@@ -71,7 +75,7 @@ func CgoSignalDeadlock() {
select {
case <-ping:
case <-time.After(time.Second):
- fmt.Printf("HANG\n")
+ fmt.Printf("HANG 2 %v\n", times)
return
}
fmt.Printf("OK\n")