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

spanner.cloud-client.snippets_test: test_query_data_with_timestamp_parameter failed #4197

Closed
flaky-bot bot opened this issue Jun 29, 2020 · 10 comments · Fixed by #4198, #4289 or #4471
Closed

spanner.cloud-client.snippets_test: test_query_data_with_timestamp_parameter failed #4197

flaky-bot bot opened this issue Jun 29, 2020 · 10 comments · Fixed by #4198, #4289 or #4471
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. 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 Jun 29, 2020

Note: #3543 was also for this test, but it was closed more than 10 days ago. So, I didn't mark it flaky.


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

Test output
Traceback (most recent call last):
  File "/workspace/spanner/cloud-client/snippets_test.py", line 358, in test_query_data_with_timestamp_parameter
    assert 'VenueId: 4, VenueName: Venue 4, LastUpdateTime:' in out
AssertionError: assert 'VenueId: 4, VenueName: Venue 4, LastUpdateTime:' in ''
@flaky-bot flaky-bot bot added buildcop: issue 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 Jun 29, 2020
@flaky-bot
Copy link
Author

flaky-bot bot commented Jun 29, 2020

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 (3680196), this test passed in one build (Build Status, Sponge) and failed in another build (Build Status, Sponge).

@tmatsuo tmatsuo self-assigned this Jun 29, 2020
@tmatsuo
Copy link
Contributor

tmatsuo commented Jun 29, 2020

I'm not 100% confident, but the spanner tests has the following code:

def unique_database_id():
    """ Creates a unique id for the database. """
    return 'test-db-{}'.format(''.join(random.choice(
        string.ascii_lowercase + string.digits) for _ in range(5)))

Is it possible that on multiple machines, random gets the same seed then we get the same random id?

Anyways, maybe we can just use uuid4.

tmatsuo pushed a commit to tmatsuo/python-docs-samples that referenced this issue Jun 29, 2020
tmatsuo pushed a commit that referenced this issue Jun 29, 2020
@flaky-bot flaky-bot bot reopened this Jul 3, 2020
@flaky-bot
Copy link
Author

flaky-bot bot commented Jul 3, 2020

Oops! Looks like this issue is still flaky. It failed again. 😬

I reopened the issue, but a human will need to close it again.


commit: 51a66f9
buildURL: Build Status, Sponge
status: failed

Test output
Traceback (most recent call last):
  File "/workspace/spanner/cloud-client/snippets_test.py", line 356, in test_query_data_with_timestamp_parameter
    assert 'VenueId: 4, VenueName: Venue 4, LastUpdateTime:' in out
AssertionError: assert 'VenueId: 4, VenueName: Venue 4, LastUpdateTime:' in ''

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Jul 6, 2020
@tmatsuo tmatsuo added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed 🚨 This issue needs some love. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels Jul 6, 2020
@tmatsuo
Copy link
Contributor

tmatsuo commented Jul 6, 2020

Needs more investigation

@tmatsuo
Copy link
Contributor

tmatsuo commented Jul 8, 2020

@larkee

test_query_data_with_timestamp_parameter occasionally fails. The output seems empty.

Do you have any idea why this is happening?

@larkee
Copy link
Contributor

larkee commented Jul 13, 2020

There was a similar issue in Go: GoogleCloudPlatform/golang-samples#1146

Basically, a time drift can happen between local machine and spanner servers. insert_datatypes_data uses the spanner server time for the commit timestamp while query_data_with_timestamp_parameter uses the local server time. This means if not enough time has passed, the local server time could still be less than the commit time which means no results are returned.

To resolve this, a sleep delay needs to be added. I'll create the PR now.

@flaky-bot
Copy link
Author

flaky-bot bot commented Jul 20, 2020

Oops! Looks like this issue is still flaky. It failed again. 😬

I reopened the issue, but a human will need to close it again.


commit: 3e55269
buildURL: Build Status, Sponge
status: failed

Test output
Traceback (most recent call last):
  File "/workspace/spanner/cloud-client/snippets_test.py", line 371, in test_query_data_with_timestamp_parameter
    assert 'VenueId: 4, VenueName: Venue 4, LastUpdateTime:' in out
AssertionError: assert 'VenueId: 4, VenueName: Venue 4, LastUpdateTime:' in ''

@flaky-bot flaky-bot bot reopened this Jul 20, 2020
@tmatsuo
Copy link
Contributor

tmatsuo commented Jul 20, 2020

Potentially we need longer sleep. Can we just use the future time instead of using the current time in the sample code?

@tmatsuo
Copy link
Contributor

tmatsuo commented Aug 5, 2020

I haven't seen this flake for a while. I'll close this and take care of it when we see this again.

@tmatsuo tmatsuo closed this as completed Aug 5, 2020
@flaky-bot
Copy link
Author

flaky-bot bot commented Aug 10, 2020

Oops! Looks like this issue is still flaky. It failed again. 😬

I reopened the issue, but a human will need to close it again.


commit: 2c0d10c
buildURL: Build Status, Sponge
status: failed

Test output
Traceback (most recent call last):
  File "/workspace/spanner/cloud-client/snippets_test.py", line 371, in test_query_data_with_timestamp_parameter
    assert 'VenueId: 4, VenueName: Venue 4, LastUpdateTime:' in out
AssertionError: assert 'VenueId: 4, VenueName: Venue 4, LastUpdateTime:' in ''

@flaky-bot flaky-bot bot reopened this Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
3 participants