Skip to content

com.example.spanner.SpannerSampleIT: testSample failed #5156

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

Closed
flaky-bot bot opened this issue Apr 29, 2021 · 7 comments
Closed

com.example.spanner.SpannerSampleIT: testSample failed #5156

flaky-bot bot opened this issue Apr 29, 2021 · 7 comments
Assignees
Labels
api: spanner Issues related to the Spanner API. flakybot: flaky Tells the Flaky Bot not to close or comment on this issue. flakybot: issue An issue filed by the Flaky Bot. Should not be added manually. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. samples Issues that are directly related to samples. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@flaky-bot
Copy link

flaky-bot bot commented Apr 29, 2021

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: d7cfb2d
buildURL: Build Status, Sponge
status: failed

Test output
com.google.common.truth.AssertionErrorWithFacts: 
expected to contain:
    1 1 NULL
but was:
    1 1 100000
    1 2 NULL
    2 1 NULL
    2 2 500000
    2 3 NULL
    Closed client
at com.example.spanner.SpannerSampleIT.testSample(SpannerSampleIT.java:137)

@flaky-bot flaky-bot bot added flakybot: issue An issue filed by the Flaky Bot. Should not be added manually. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Apr 29, 2021
@product-auto-label product-auto-label bot added api: spanner Issues related to the Spanner API. samples Issues that are directly related to samples. labels Apr 29, 2021
@averikitsch averikitsch assigned olavloite and unassigned averikitsch Apr 29, 2021
@flaky-bot flaky-bot bot added the flakybot: flaky Tells the Flaky Bot not to close or comment on this issue. label Apr 29, 2021
@flaky-bot
Copy link
Author

flaky-bot bot commented Apr 29, 2021

Looks like this issue is flaky. 😟

I'm going to leave this open and stop commenting.

A human should fix and close this.


When run at the same commit (d7cfb2d), this test passed in one build (Build Status, Sponge) and failed in another build (Build Status, Sponge).

@olavloite
Copy link
Contributor

This problem is probably caused because of temporary slowness of either the backend or the client itself. What this test does is the following:

  1. Insert data into table A.
  2. Wait 16 seconds.
  3. Update the data in table A.
  4. Execute a query on table A that reads with an exact staleness of 15 seconds.

The above steps should normally produce the data that was in the table after the insert in step 1, and without the update in step 3. However, if for some reason the client is slowed down a lot between step 3 and 4, or the backend is very slow to respond to the query request in step 4, it could be that more than 15 seconds has elapsed since the update in step 3 was executed. That will produce unexpected results for the query in step 4.

Fixing this in a 100% watertight way without changing the sample itself seems to be impossible. I would suggest:

  1. The above will probably happen very infrequently (I can't remember having seen this before, and this code has been unchanged for very long time). We could just close it for now and assume that it is very unlikely to come back, and if it does; re-evaluate.
  2. Change the sample to a standalone sample file and standalone test. The test could then retry if this specific error occurs, and potentially also check the time it took between step 3 and 4 which is where I suspect that the error is coming from.

@skuruppu @thiagotnunes Any thoughts on the above?

@thiagotnunes
Copy link
Contributor

thiagotnunes commented May 3, 2021

Hey @olavloite thanks for the analysis.

I would vote for option (2), since it brings us closer to where we would like the samples to be. I would, however, add a small change: increase the waiting time in step (2) to reduce the flaky behaviour.

@thiagotnunes
Copy link
Contributor

Oh wait, I just realised these failures are in the java-docs-samples, so these samples are outdated. We should remove the cloud-client samples and associated tests from here if possible. I will discuss this with @skuruppu

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label May 8, 2021
@zoercai
Copy link

zoercai commented May 19, 2021

@thiagotnunes any updates for this?

@zoercai zoercai removed the 🚨 This issue needs some love. label May 19, 2021
@thiagotnunes
Copy link
Contributor

@zoercai we will remove the cloud-client directory, since the samples moved to the java-spanner codebase. @olavloite will be taking that on.

@lesv
Copy link
Contributor

lesv commented May 20, 2021

directory removed.

@lesv lesv closed this as completed May 20, 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. flakybot: flaky Tells the Flaky Bot not to close or comment on this issue. flakybot: issue An issue filed by the Flaky Bot. Should not be added manually. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. samples Issues that are directly related to samples. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

6 participants