Skip to content

Commit

Permalink
fix: wait up to 20 seconds for blob to appear (#3061)
Browse files Browse the repository at this point in the history
This test fails sometimes with a 3 second wait. Extend this wait, but poll to avoid taking all the time.
  • Loading branch information
crwilcox authored Mar 9, 2020
1 parent dffa18e commit dd8984f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions video/cloud-client/analyze/beta_snippets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,15 @@ def test_annotation_to_storage_streaming(capsys, video_path, bucket):
assert 'Storage' in out

# It takes a few seconds before the results show up on GCS.
time.sleep(3)
for _ in range(10):
time.sleep(3)

blobs_iterator = bucket.list_blobs()
blobs = [blob for blob in blobs_iterator]
if len(blobs):
break

# Confirm that one output blob had been written to GCS.
blobs_iterator = bucket.list_blobs()
blobs = [blob for blob in blobs_iterator]
assert len(blobs) == 1


Expand Down

0 comments on commit dd8984f

Please sign in to comment.