From 9babc826f335392ca3a3317ba234b83125a55bf5 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Wed, 4 Mar 2026 23:12:42 +0000 Subject: internal/database: remove sawRetries logic from TestTransactSerializable - This test has a history of flakiness. PostgreSQL 14 includes significant improvements to its Serializable Snapshot Isolation which means it is much efficient in reducing false positive serialization conflicts. To amend this, this test now focuses on data integrity rather than an arbitary retry counter. Change-Id: I7d9a46303a6cc4eb011d9d3764ebf0c61e2d6287 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/751680 Reviewed-by: Hyang-Ah Hana Kim kokoro-CI: kokoro LUCI-TryBot-Result: Go LUCI Auto-Submit: Ethan Lee --- internal/database/database_test.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/internal/database/database_test.go b/internal/database/database_test.go index 43b02d74..600ecc4f 100644 --- a/internal/database/database_test.go +++ b/internal/database/database_test.go @@ -394,7 +394,6 @@ func testTransactSerializable(ctx context.Context, t *testing.T) string { return err } - sawRetries := false for i := 0; i < 10; i++ { for _, stmt := range []string{ `DROP TABLE IF EXISTS ser`, @@ -423,16 +422,6 @@ func testTransactSerializable(ctx context.Context, t *testing.T) string { return err.Error() } } - t.Logf("max retries: %d", testDB.MaxRetries()) - // If nothing got retried, this test isn't exercising some important behavior. - // Try again. - if testDB.MaxRetries() > 0 { - sawRetries = true - break - } - } - if !sawRetries { - return "did not see any retries" } // Demonstrate serializability: there should be numTransactions new rows in -- cgit v1.3