]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/race: don't complain about unrun tests when fatal map access happens
authorDamien Neil <dneil@google.com>
Thu, 20 Mar 2025 20:33:49 +0000 (13:33 -0700)
committerDamien Neil <dneil@google.com>
Thu, 20 Mar 2025 22:02:35 +0000 (15:02 -0700)
Fixes #72964

Change-Id: I42c6994fec3b21774bddd1d4d65dc832d9149446
Reviewed-on: https://go-review.googlesource.com/c/go/+/659697
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/runtime/race/race_test.go

index 98936e3d3e2b32d6d7a190799064350e47d4c807..1c8bc949bfed7b8980290090eb143a7512f32fa1 100644 (file)
@@ -190,6 +190,12 @@ func runTests(t *testing.T) ([]byte, error) {
                // in the map concurrent access detector).
                return out, errors.New("runtime fatal error")
        }
+       // A crash in the map concurrent access detector will cause other tests not to run.
+       // Perhaps we should run tests with concurrent map access separately to avoid this,
+       // but for the moment just skip the remaining tests.
+       if mapFatals == 0 {
+               return out, nil
+       }
        if !bytes.Contains(out, []byte("ALL TESTS COMPLETE")) {
                return out, errors.New("not all tests ran")
        }