From 79df7651d42997b6f9ec7157278e6b5342325d7f Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Wed, 9 Aug 2017 14:54:32 -0700 Subject: [PATCH] De-flake the snapshot system test. (#3780) --- pubsub/tests/system.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pubsub/tests/system.py b/pubsub/tests/system.py index bbc4b527db8eb..eddfd1274da08 100644 --- a/pubsub/tests/system.py +++ b/pubsub/tests/system.py @@ -348,7 +348,10 @@ 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 +364,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,