From 54e5540014f7aa7c85a3a5988259ef40637d541a Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Wed, 3 Dec 2025 22:21:07 +0000 Subject: [PATCH] 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 --- src/runtime/goroutineleakprofile_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) } -- 2.52.0