From 0af87b225c32161ed3fed3fc24f8122a94626235 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Wed, 8 Nov 2017 16:17:42 -0800 Subject: [PATCH] Bump spanner stale read from 10 to 15 seconds. [(#1207)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1207) At the request of the spanner team. --- samples/samples/snippets.py | 4 ++-- samples/samples/snippets_test.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/samples/snippets.py b/samples/samples/snippets.py index 380254ffad..990a9fbd68 100644 --- a/samples/samples/snippets.py +++ b/samples/samples/snippets.py @@ -120,14 +120,14 @@ def read_data(instance_id, database_id): def read_stale_data(instance_id, database_id): - """Reads sample data from the database. The data is exactly 10 seconds + """Reads sample data from the database. The data is exactly 15 seconds stale.""" import datetime spanner_client = spanner.Client() instance = spanner_client.instance(instance_id) database = instance.database(database_id) - staleness = datetime.timedelta(seconds=10) + staleness = datetime.timedelta(seconds=15) with database.snapshot(exact_staleness=staleness) as snapshot: keyset = spanner.KeySet(all_=True) diff --git a/samples/samples/snippets_test.py b/samples/samples/snippets_test.py index 3a1912e055..484c3bad07 100644 --- a/samples/samples/snippets_test.py +++ b/samples/samples/snippets_test.py @@ -79,7 +79,7 @@ def test_read_stale_data(temporary_database, capsys): out, _ = capsys.readouterr() # It shouldn't be in the output because it was *just* inserted by the - # temporary database fixture and this sample reads 10 seconds into the + # temporary database fixture and this sample reads 15 seconds into the # past. assert 'Total Junk' not in out