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): update max staleness bound value #10118

Merged
merged 1 commit into from
May 6, 2024

Conversation

harshachinta
Copy link
Contributor

@harshachinta harshachinta commented May 6, 2024

TestIntegration_SingleUse/max_staleness is showing flaky behavior and this PR fixes it.

Background: The current test has a Max staleness value of 1 sec. This Bounded staleness mode allow Spanner to pick the read timestamp, subject to a user- provided staleness bound. Spanner chooses the newest timestamp within the provided staleness bound. More details [here](https://cloud.google.com/spanner/docs/timestamp-bounds#bounded_staleness).

Flakiness Reason: The test verifies whether the chosen read timestamp is after writes[3] timestamp. But since the staleness value is 1 sec, the chosen timestamp by spanner can be much before the writes[3] timestamp which gices a flaky behaviour with below error

SingleUse.Query doesn't return expected timestamp: read got timestamp 2024-05-02 07:02:58.245414 +0000 UTC, want it to be no earlier than 2024-05-02 07:02:58.289881 +0000 UTC

Choosing a lower value of staleness ensures that the chosen timestamp is always above the writes[3] timestamp.

Fixes #10084

@harshachinta harshachinta requested review from a team as code owners May 6, 2024 07:49
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label May 6, 2024
Copy link
Contributor

@rahul2393 rahul2393 left a comment

Choose a reason for hiding this comment

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

Can we do this, instead of reducing the max staleness, so that the check is more understandable?

@rahul2393 rahul2393 merged commit c07f1e4 into googleapis:main May 6, 2024
8 checks passed
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spanner: TestIntegration_SingleUse failed
2 participants