From c69a562f50a867b7f9a42224050be01b8620ebbc Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Wed, 9 Aug 2017 14:31:26 -0700 Subject: [PATCH 1/2] De-flake the snapshot system test. --- pubsub/tests/system.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pubsub/tests/system.py b/pubsub/tests/system.py index bbc4b527db8e..e085ce1d155b 100644 --- a/pubsub/tests/system.py +++ b/pubsub/tests/system.py @@ -348,7 +348,9 @@ def test_create_snapshot(self): # There is no GET method for snapshot, so check existence using # list - retry = RetryResult(lambda result: result, max_tries=4) + def retry_predicate(result): + return len(result) > len(before_snapshots) + retry = RetryResult(retry_predicate, max_tries=5) after_snapshots = retry(_consume_snapshots)(Config.CLIENT) self.assertEqual(len(before_snapshots) + 1, len(after_snapshots)) @@ -361,7 +363,6 @@ def full_name(obj): with self.assertRaises(Conflict): snapshot.create() - def test_seek(self): TOPIC_NAME = 'seek-e2e' + unique_resource_id('-') topic = Config.CLIENT.topic(TOPIC_NAME, From c207b347255848fb2ad0b025fdafa64cb15b0a77 Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Wed, 9 Aug 2017 14:54:15 -0700 Subject: [PATCH 2/2] Add newline. --- pubsub/tests/system.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pubsub/tests/system.py b/pubsub/tests/system.py index e085ce1d155b..eddfd1274da0 100644 --- a/pubsub/tests/system.py +++ b/pubsub/tests/system.py @@ -350,6 +350,7 @@ def test_create_snapshot(self): # list def retry_predicate(result): return len(result) > len(before_snapshots) + retry = RetryResult(retry_predicate, max_tries=5) after_snapshots = retry(_consume_snapshots)(Config.CLIENT) self.assertEqual(len(before_snapshots) + 1, len(after_snapshots))