From 97d631232b89cb45a61c7b7c05785c6e5b90842b Mon Sep 17 00:00:00 2001 From: larkee <31196561+larkee@users.noreply.github.com> Date: Tue, 14 Jul 2020 02:52:20 +1200 Subject: [PATCH] test(spanner): add sleep to fix flaky test (#4289) Co-authored-by: larkee --- spanner/cloud-client/snippets_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spanner/cloud-client/snippets_test.py b/spanner/cloud-client/snippets_test.py index 49a11dce91a4..0ec3ef42b7c0 100644 --- a/spanner/cloud-client/snippets_test.py +++ b/spanner/cloud-client/snippets_test.py @@ -363,6 +363,9 @@ def test_query_data_with_string(capsys): def test_query_data_with_timestamp_parameter(capsys): + # Wait 5 seconds to avoid a time drift issue for the next query: + # https://github.com/GoogleCloudPlatform/python-docs-samples/issues/4197. + time.sleep(5) snippets.query_data_with_timestamp_parameter(INSTANCE_ID, DATABASE_ID) out, _ = capsys.readouterr() assert 'VenueId: 4, VenueName: Venue 4, LastUpdateTime:' in out