From cb7388110267e904b21397b698b8fada9395545d Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Mon, 20 Apr 2020 15:23:18 -0700 Subject: [PATCH] [video] testing: mark some tests witih flaky fixes #3275 --- video/cloud-client/analyze/analyze_test.py | 11 ++++++----- video/cloud-client/analyze/beta_snippets_test.py | 13 ++++++------- .../analyze/video_detect_faces_beta_test.py | 3 +++ .../analyze/video_detect_faces_gcs_beta_test.py | 3 +++ .../analyze/video_detect_logo_gcs_test.py | 4 ++++ .../cloud-client/analyze/video_detect_logo_test.py | 4 ++++ .../analyze/video_detect_person_beta_test.py | 3 +++ .../analyze/video_detect_person_gcs_beta_test.py | 3 +++ 8 files changed, 32 insertions(+), 12 deletions(-) diff --git a/video/cloud-client/analyze/analyze_test.py b/video/cloud-client/analyze/analyze_test.py index faa60fd7e68..6623fd32698 100644 --- a/video/cloud-client/analyze/analyze_test.py +++ b/video/cloud-client/analyze/analyze_test.py @@ -15,7 +15,6 @@ # limitations under the License. import pytest -from flaky import flaky import analyze @@ -71,7 +70,7 @@ def test_speech_transcription(capsys): # Flaky timeout -@flaky(max_runs=3, min_passes=1) +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_detect_text_gcs(capsys): analyze.video_detect_text_gcs("gs://cloud-samples-data/video/googlework_tiny.mp4") out, _ = capsys.readouterr() @@ -79,21 +78,23 @@ def test_detect_text_gcs(capsys): # Flaky timeout -@flaky(max_runs=3, min_passes=1) +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_detect_text(capsys): analyze.video_detect_text("resources/googlework_tiny.mp4") out, _ = capsys.readouterr() assert 'Text' in out -@pytest.mark.slow +# Flaky timeout +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_track_objects_gcs(capsys): analyze.track_objects_gcs("gs://cloud-samples-data/video/cat.mp4") out, _ = capsys.readouterr() assert "cat" in out -@pytest.mark.slow +# Flaky timeout +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_track_objects(capsys): in_file = "./resources/googlework_tiny.mp4" analyze.track_objects(in_file) diff --git a/video/cloud-client/analyze/beta_snippets_test.py b/video/cloud-client/analyze/beta_snippets_test.py index bde878c3092..d7d119147e7 100644 --- a/video/cloud-client/analyze/beta_snippets_test.py +++ b/video/cloud-client/analyze/beta_snippets_test.py @@ -18,11 +18,10 @@ import os import uuid -import beta_snippets from google.cloud import storage import pytest -from flaky import flaky +import beta_snippets POSSIBLE_TEXTS = [ "Google", @@ -114,7 +113,7 @@ def test_annotation_to_storage_streaming(capsys, video_path, bucket): # Flaky timeout -@flaky(max_runs=3, min_passes=1) +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_detect_text(capsys): in_file = "./resources/googlework_tiny.mp4" beta_snippets.video_detect_text(in_file) @@ -123,15 +122,15 @@ def test_detect_text(capsys): # Flaky timeout -@flaky(max_runs=3, min_passes=1) +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_detect_text_gcs(capsys): in_file = "gs://python-docs-samples-tests/video/googlework_tiny.mp4" beta_snippets.video_detect_text_gcs(in_file) out, _ = capsys.readouterr() assert 'Text' in out - -@pytest.mark.slow +# Flaky InvalidArgument +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_track_objects(capsys): in_file = "./resources/googlework_tiny.mp4" beta_snippets.track_objects(in_file) @@ -154,7 +153,7 @@ def test_track_objects_gcs(): # Flaky Gateway -@flaky(max_runs=3, min_passes=1) +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_streaming_automl_classification(capsys, video_path): project_id = os.environ["GCLOUD_PROJECT"] model_id = "VCN6363999689846554624" diff --git a/video/cloud-client/analyze/video_detect_faces_beta_test.py b/video/cloud-client/analyze/video_detect_faces_beta_test.py index 916c11bba24..175f2b48361 100644 --- a/video/cloud-client/analyze/video_detect_faces_beta_test.py +++ b/video/cloud-client/analyze/video_detect_faces_beta_test.py @@ -14,11 +14,14 @@ import os +import pytest + import video_detect_faces_beta RESOURCES = os.path.join(os.path.dirname(__file__), "resources") +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_detect_faces(capsys): local_file_path = os.path.join(RESOURCES, "googlework_short.mp4") diff --git a/video/cloud-client/analyze/video_detect_faces_gcs_beta_test.py b/video/cloud-client/analyze/video_detect_faces_gcs_beta_test.py index 611a6f38c1d..e4f666aeb95 100644 --- a/video/cloud-client/analyze/video_detect_faces_gcs_beta_test.py +++ b/video/cloud-client/analyze/video_detect_faces_gcs_beta_test.py @@ -14,11 +14,14 @@ import os +import pytest + import video_detect_faces_gcs_beta RESOURCES = os.path.join(os.path.dirname(__file__), "resources") +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_detect_faces(capsys): input_uri = "gs://cloud-samples-data/video/googlework_short.mp4" diff --git a/video/cloud-client/analyze/video_detect_logo_gcs_test.py b/video/cloud-client/analyze/video_detect_logo_gcs_test.py index 0dd63a79783..2837638efe9 100644 --- a/video/cloud-client/analyze/video_detect_logo_gcs_test.py +++ b/video/cloud-client/analyze/video_detect_logo_gcs_test.py @@ -14,11 +14,15 @@ import os +import pytest + import video_detect_logo_gcs RESOURCES = os.path.join(os.path.dirname(__file__), "resources") +# Flaky Deadline +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_detect_logo_gcs(capsys): input_uri = "gs://cloud-samples-data/video/googlework_tiny.mp4" diff --git a/video/cloud-client/analyze/video_detect_logo_test.py b/video/cloud-client/analyze/video_detect_logo_test.py index 528d3b4b6ff..08e27f4ef76 100644 --- a/video/cloud-client/analyze/video_detect_logo_test.py +++ b/video/cloud-client/analyze/video_detect_logo_test.py @@ -14,11 +14,15 @@ import os +import pytest + import video_detect_logo RESOURCES = os.path.join(os.path.dirname(__file__), "resources") +# Flaky Bad Gateway +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_detect_logo(capsys): local_file_path = os.path.join(RESOURCES, "googlework_tiny.mp4") diff --git a/video/cloud-client/analyze/video_detect_person_beta_test.py b/video/cloud-client/analyze/video_detect_person_beta_test.py index 567fed336a3..4b7ce2ae482 100644 --- a/video/cloud-client/analyze/video_detect_person_beta_test.py +++ b/video/cloud-client/analyze/video_detect_person_beta_test.py @@ -14,11 +14,14 @@ import os +import pytest + import video_detect_person_beta RESOURCES = os.path.join(os.path.dirname(__file__), "resources") +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_detect_person(capsys): local_file_path = os.path.join(RESOURCES, "googlework_tiny.mp4") diff --git a/video/cloud-client/analyze/video_detect_person_gcs_beta_test.py b/video/cloud-client/analyze/video_detect_person_gcs_beta_test.py index 521959253ba..629e141ac86 100644 --- a/video/cloud-client/analyze/video_detect_person_gcs_beta_test.py +++ b/video/cloud-client/analyze/video_detect_person_gcs_beta_test.py @@ -14,11 +14,14 @@ import os +import pytest + import video_detect_person_gcs_beta RESOURCES = os.path.join(os.path.dirname(__file__), "resources") +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_detect_person(capsys): input_uri = "gs://cloud-samples-data/video/googlework_tiny.mp4"