From: Michael Anthony Knyszek Date: Wed, 3 Dec 2025 22:21:07 +0000 (+0000) Subject: runtime: print output in case of segfault in goroutine leak tests X-Git-Tag: go1.26rc1~2^2~9 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=54e5540014f7aa7c85a3a5988259ef40637d541a;p=gostls13.git 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 Reviewed-by: Michael Pratt Auto-Submit: Michael Knyszek --- diff --git a/src/runtime/goroutineleakprofile_test.go b/src/runtime/goroutineleakprofile_test.go index 40c6a4709d..35f7dc6879 100644 --- a/src/runtime/goroutineleakprofile_test.go +++ b/src/runtime/goroutineleakprofile_test.go @@ -487,9 +487,9 @@ func TestGoroutineLeakProfile(t *testing.T) { testCases = append(testCases, patternTestCases...) // Test cases must not panic or cause fatal exceptions. - failStates := regexp.MustCompile(`fatal|panic|DATA RACE`) + failStates := regexp.MustCompile(`segmentation fault|fatal|panic|DATA RACE`) - testApp := func(exepath string, testCases []testCase) { + runTests := func(exepath string, testCases []testCase) { // Build the test program once. exe, err := buildTestProg(t, exepath) @@ -598,6 +598,6 @@ func TestGoroutineLeakProfile(t *testing.T) { } } - testApp("testgoroutineleakprofile", testCases) - testApp("testgoroutineleakprofile/goker", gokerTestCases) + runTests("testgoroutineleakprofile", testCases) + runTests("testgoroutineleakprofile/goker", gokerTestCases) }