From 79a998afa141d3fb91285f0074e88b7738dc52a3 Mon Sep 17 00:00:00 2001 From: Chris Wilcox Date: Mon, 9 Mar 2020 10:39:09 -0700 Subject: [PATCH 1/2] fix: Wait up to 20 seconds for blob to appear --- video/cloud-client/analyze/beta_snippets_test.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/video/cloud-client/analyze/beta_snippets_test.py b/video/cloud-client/analyze/beta_snippets_test.py index 9a52dd1ff2e..7b13591d721 100644 --- a/video/cloud-client/analyze/beta_snippets_test.py +++ b/video/cloud-client/analyze/beta_snippets_test.py @@ -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 From f193f4a2e67bd078cb2897ff4474f6f4933d5907 Mon Sep 17 00:00:00 2001 From: Christopher Wilcox Date: Mon, 9 Mar 2020 14:19:00 -0700 Subject: [PATCH 2/2] fix: remove whitespace --- video/cloud-client/analyze/beta_snippets_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/cloud-client/analyze/beta_snippets_test.py b/video/cloud-client/analyze/beta_snippets_test.py index 7b13591d721..a36f741d67a 100644 --- a/video/cloud-client/analyze/beta_snippets_test.py +++ b/video/cloud-client/analyze/beta_snippets_test.py @@ -108,7 +108,7 @@ def test_annotation_to_storage_streaming(capsys, video_path, bucket): blobs = [blob for blob in blobs_iterator] if len(blobs): break - + # Confirm that one output blob had been written to GCS. assert len(blobs) == 1