]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: add more debug info to flaky TestNumGoroutine
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 27 Jan 2016 00:09:50 +0000 (00:09 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 27 Jan 2016 02:51:01 +0000 (02:51 +0000)
This has been flaking on the new OpenBSD 5.8 builders lately:
https://storage.googleapis.com/go-build-log/808270e7/openbsd-amd64-gce58_61ce2663.log
(as one example)

Add more debug info when it fails.

Updates #14107

Change-Id: Ie30bc0c703d2e9ee993d1e232ffc5f2d17e65c97
Reviewed-on: https://go-review.googlesource.com/18938
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/runtime/proc_test.go

index f3e90bcbd76b4ea7dc33dc38cbd466e92581cbb2..34d90a1c9bfe95a0afe1bcc60eedbec980eafc78 100644 (file)
@@ -350,7 +350,7 @@ func TestNumGoroutine(t *testing.T) {
        n := runtime.NumGoroutine()
 
        if nstk := strings.Count(string(buf), "goroutine "); n != nstk {
-               t.Fatalf("NumGoroutine=%d, but found %d goroutines in stack dump", n, nstk)
+               t.Fatalf("NumGoroutine=%d, but found %d goroutines in stack dump: %s", n, nstk, buf)
        }
 }