Skip to content

Commit cee0672

Browse files
lukesneeringerlandrito
authored andcommitted
De-flake the snapshot system test. (googleapis#3780)
1 parent 92166f9 commit cee0672

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pubsub/tests/system.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,10 @@ def test_create_snapshot(self):
348348

349349
# There is no GET method for snapshot, so check existence using
350350
# list
351-
retry = RetryResult(lambda result: result, max_tries=4)
351+
def retry_predicate(result):
352+
return len(result) > len(before_snapshots)
353+
354+
retry = RetryResult(retry_predicate, max_tries=5)
352355
after_snapshots = retry(_consume_snapshots)(Config.CLIENT)
353356
self.assertEqual(len(before_snapshots) + 1, len(after_snapshots))
354357

@@ -361,7 +364,6 @@ def full_name(obj):
361364
with self.assertRaises(Conflict):
362365
snapshot.create()
363366

364-
365367
def test_seek(self):
366368
TOPIC_NAME = 'seek-e2e' + unique_resource_id('-')
367369
topic = Config.CLIENT.topic(TOPIC_NAME,

0 commit comments

Comments
 (0)