test: fix TestTransactionTimeoutSecondStatement by increasing timeout#653
Open
HankStat wants to merge 1 commit intogoogleapis:mainfrom
Open
test: fix TestTransactionTimeoutSecondStatement by increasing timeout#653HankStat wants to merge 1 commit intogoogleapis:mainfrom
TestTransactionTimeoutSecondStatement by increasing timeout#653HankStat wants to merge 1 commit intogoogleapis:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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 exceeded` error or `spanner: code = "DeadlineExceeded"...` error. Solution: By running the test 10,000 times with the -race flag, I found that only setting transaction_timeout to at least 1s passees 10,000 times. I have experimented with 0.06s, 0.2s, and 0.5s. However, all of them (0.06s, 0.2s, and 0.5s) fail before passing 10,000 times. Signed-off-by: Yong-Han Chen <hank96015@gmail.com>
7842dbc to
5581be6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.