Skip to content

Commit 54e5540

Browse files
mknyszekgopherbot
authored andcommitted
runtime: print output in case of segfault in goroutine leak tests
For #76526. Change-Id: I017e5d4c06e5de23cccc59c4c347599fecdece03 Reviewed-on: https://go-review.googlesource.com/c/go/+/726524 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com>
1 parent 9616c33 commit 54e5540

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/runtime/goroutineleakprofile_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -487,9 +487,9 @@ func TestGoroutineLeakProfile(t *testing.T) {
487487
testCases = append(testCases, patternTestCases...)
488488

489489
// Test cases must not panic or cause fatal exceptions.
490-
failStates := regexp.MustCompile(`fatal|panic|DATA RACE`)
490+
failStates := regexp.MustCompile(`segmentation fault|fatal|panic|DATA RACE`)
491491

492-
testApp := func(exepath string, testCases []testCase) {
492+
runTests := func(exepath string, testCases []testCase) {
493493

494494
// Build the test program once.
495495
exe, err := buildTestProg(t, exepath)
@@ -598,6 +598,6 @@ func TestGoroutineLeakProfile(t *testing.T) {
598598
}
599599
}
600600

601-
testApp("testgoroutineleakprofile", testCases)
602-
testApp("testgoroutineleakprofile/goker", gokerTestCases)
601+
runTests("testgoroutineleakprofile", testCases)
602+
runTests("testgoroutineleakprofile/goker", gokerTestCases)
603603
}

0 commit comments

Comments
 (0)