diff --git a/src/pkg/runtime/debug/stack_test.go b/src/pkg/runtime/debug/stack_test.go index f1a307579cf..cf4bd0238e7 100644 --- a/src/pkg/runtime/debug/stack_test.go +++ b/src/pkg/runtime/debug/stack_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package debug_test +package debug import ( . "runtime/debug" diff --git a/src/pkg/testing/testing.go b/src/pkg/testing/testing.go index b60d5c1b0d4..bbacf8ba502 100644 --- a/src/pkg/testing/testing.go +++ b/src/pkg/testing/testing.go @@ -71,7 +71,6 @@ import ( "fmt" "os" "runtime" - "runtime/debug" "runtime/pprof" "strconv" "strings" @@ -248,13 +247,12 @@ func tRunner(t *T, test *InternalTest) { // a call to runtime.Goexit, record the duration and send // a signal saying that the test is done. defer func() { - // Log and recover from panic instead of aborting binary. - if err := recover(); err != nil { - t.failed = true - t.Logf("%s\n%s", err, debug.Stack()) - } - t.duration = time.Now().Sub(t.start) + // If the test panicked, print any test output before dying. + if err := recover(); err != nil { + t.report() + panic(err) + } t.signal <- t }()