Skip to content

Commit

Permalink
Merge pull request #1769 from josephschorr/fix-retry-test-flake
Browse files Browse the repository at this point in the history
Fix flake on transaction retry test by specifying a longer timeout
  • Loading branch information
josephschorr authored Feb 28, 2024
2 parents 5a32447 + 0379e0f commit 66a871c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/datastore/test/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func RetryTest(t *testing.T, tester DatastoreTester) {

ds := rawDS.(TestableDatastore)

ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond)
ctx, cancel := context.WithTimeout(context.Background(), 1500*time.Millisecond)
defer cancel()

var attempts int
Expand All @@ -48,7 +48,10 @@ func RetryTest(t *testing.T, tester DatastoreTester) {
}
return errors.New("not retryable")
}, tc.txOptions...)

require.GreaterOrEqual(attempts, 1)
require.Error(err)

retries := attempts - 1
tc.countAssertion(t, retries)
})
Expand Down

0 comments on commit 66a871c

Please sign in to comment.