]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: print output in case of segfault in goroutine leak tests
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 3 Dec 2025 22:21:07 +0000 (22:21 +0000)
committerGopher Robot <gobot@golang.org>
Fri, 5 Dec 2025 18:38:28 +0000 (10:38 -0800)
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>

src/runtime/goroutineleakprofile_test.go

index 40c6a4709d00416d0ed66209bfe7e5aacd880143..35f7dc6879c9ece2b1e1e104290ea75138b9c8b5 100644 (file)
@@ -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)
 }