test: fix TestTransactionTimeoutSecondStatement by increasing timeout
#653
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which issue this PR fixes
Fixes #625
Problem
The test is flaky in CI because the local transaction_timeout(20ms) is too tight to complete the update operation, leading to a
context deadline exceedederror orspanner: code = "DeadlineExceeded"...error.Solution
Increase the
transaction_timeoutto 1s and theMinimumExecutionTimeto 1.5s.I executed the tests by running 10,000 times with the
-raceflag:transaction_timeout= 1s, Passedtransaction_timeout= 0.06s, Failedtransaction_timeout= 0.2s, Failedtransaction_timeout= 0.5s, FailedVerification
The test now passes on my local machine after running it 10,000 times using a loop to simulate the flaky behavior within 10,521 seconds.
I observed several pass tests taking 1.88s, 1.84s, and 1.81s with
transaction_timeout= 1s, which proves that increasingtransaction_timeoutis necessary to prevent CI rerun.