aboutsummaryrefslogtreecommitdiff
path: root/internal/database/database_test.go
diff options
context:
space:
mode:
authorEthan Lee <ethanalee@google.com>2026-03-04 23:12:42 +0000
committerGopher Robot <gobot@golang.org>2026-03-05 09:51:55 -0800
commit9babc826f335392ca3a3317ba234b83125a55bf5 (patch)
tree3922e55b2c005e9170def1e5f43cbb375c699aab /internal/database/database_test.go
parentd3bd4773859f3ab03cbbdf35026ad71fffc28196 (diff)
downloadgo-x-pkgsite-9babc826f335392ca3a3317ba234b83125a55bf5.tar.xz
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 <hyangah@gmail.com> kokoro-CI: kokoro <noreply+kokoro@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ethan Lee <ethanalee@google.com>
Diffstat (limited to 'internal/database/database_test.go')
-rw-r--r--internal/database/database_test.go11
1 files changed, 0 insertions, 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