Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(spanner): fix flaky TestReadWriteTransaction_ContextTimeoutDuringDuringCommit #3915

Merged

Conversation

yfuruyama
Copy link
Contributor

fixes #3914

As the following test message shows, it looks like the context is cancelled while the session is dynamically created for the transaction. To fix this issue, I used SessionPoolConfig to create a session explicitly and wait for the session to be created before we start testing the actual timeout for the commit.

2021/04/12 14:47:21 Integration tests skipped: GCLOUD_TESTS_GOLANG_PROJECT_ID is missing
=== RUN   TestReadWriteTransaction_ContextTimeoutDuringDuringCommit
=== PAUSE TestReadWriteTransaction_ContextTimeoutDuringDuringCommit
=== CONT  TestReadWriteTransaction_ContextTimeoutDuringDuringCommit
    client_test.go:1776: Error message mismatch:
        Got spanner: code = "DeadlineExceeded", desc = "timeout / context canceled during getting session.\nEnable SessionPoolConfig.TrackSessionHandles if you suspect a session leak to get more information about the checked out sessions."
        Want: spanner: code = "DeadlineExceeded", desc = "context deadline exceeded, transaction outcome unknown"
--- FAIL: TestReadWriteTransaction_ContextTimeoutDuringDuringCommit (0.21s)
FAIL
exit status 1
FAIL    cloud.google.com/go/spanner     0.496s

Also I fixed the typo in the test name: s/TestReadWriteTransaction_ContextTimeoutDuringDuringCommit/TestReadWriteTransaction_ContextTimeoutDuringCommit /.

@yfuruyama yfuruyama requested review from skuruppu and a team as code owners April 12, 2021 07:20
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Apr 12, 2021
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Apr 12, 2021
Copy link
Contributor

@hengfengli hengfengli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@hengfengli hengfengli added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 15, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 15, 2021
@hengfengli hengfengli merged commit d864346 into googleapis:master Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spanner: flaky test TestReadWriteTransaction_ContextTimeoutDuringCommit
3 participants