Skip to content

Commit

Permalink
De-flake the snapshot system test. (googleapis#3780)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukesneeringer authored and landrito committed Aug 21, 2017
1 parent 942a25f commit 79df765
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pubsub/tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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,
Expand Down

0 comments on commit 79df765

Please sign in to comment.