You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not 100% confident, but the spanner tests has the following code:
defunique_database_id():
""" Creates a unique id for the database. """return'test-db-{}'.format(''.join(random.choice(
string.ascii_lowercase+string.digits) for_inrange(5)))
Is it possible that on multiple machines, random gets the same seed then we get the same random id?
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.
Activity
flaky-bot commentedon 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 commentedon Jun 29, 2020
I'm not 100% confident, but the spanner tests has the following code:
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.
fix(spanner): use uuid for unique id
fix(spanner): use uuid for unique id (#4198)
flaky-bot commentedon 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 ''1 remaining item
tmatsuo commentedon Jul 6, 2020
Needs more investigation
tmatsuo commentedon Jul 8, 2020
@larkee
test_query_data_with_timestamp_parameteroccasionally fails. The output seems empty.Do you have any idea why this is happening?
larkee commentedon 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_datauses the spanner server time for the commit timestamp whilequery_data_with_timestamp_parameteruses 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 commentedon 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 ''tmatsuo commentedon 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 commentedon 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.
flaky-bot commentedon 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 ''fix(spanner): use future date to avoid time drift
fix(spanner): use future date to avoid time drift (#4471)