aboutsummaryrefslogtreecommitdiff
path: root/internal/database/database_test.go
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2021-06-07 15:04:20 -0400
committerJonathan Amsterdam <jba@google.com>2021-06-08 12:37:22 +0000
commit5ebe377393a10a68508cae3d5cd1b9947ad099a5 (patch)
tree438466d7f5e492b586273dc4e36cdcdc4a5e4aee /internal/database/database_test.go
parent37e31904c441f2d06e7858c403aec1937f9237d1 (diff)
downloadgo-x-pkgsite-5ebe377393a10a68508cae3d5cd1b9947ad099a5.tar.xz
internal/database: fix flaky test
Reduce the number of concurrent transactions so that there is always a conflict, but they don't reach the max number of retries. Change-Id: I15bb6c710473cbddcf070517f0eb907d708a46a7 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/325699 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Diffstat (limited to 'internal/database/database_test.go')
-rw-r--r--internal/database/database_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/database/database_test.go b/internal/database/database_test.go
index 8a0b61aa..b328a14c 100644
--- a/internal/database/database_test.go
+++ b/internal/database/database_test.go
@@ -403,7 +403,7 @@ func TestTransactSerializable(t *testing.T) {
// sum rows with class = 2 and insert as a row with class 1
// We determined empirically that this number of transactions produces a serialization conflict
// 100 times out of 100.
- const numTransactions = 7
+ const numTransactions = 5
errc := make(chan error, numTransactions)
for i := 0; i < numTransactions; i++ {
i := i