From dd98c55050f0b04404805bbec47234ff07d7af52 Mon Sep 17 00:00:00 2001 From: larkee Date: Mon, 13 Jul 2020 18:15:32 +1000 Subject: [PATCH] test(spanner): add sleep to fix flaky test --- 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 49a11dce91a..0ec3ef42b7c 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