From ff6e0f511c12c2893be0c64870d84c9b6c2eb6f3 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Fri, 24 Apr 2020 14:49:15 -0700 Subject: [PATCH] [translate] fix: mark some tests as flaky [(#3495)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/3495) tests which involve LRO. fixes #2875 --- translation/samples/snippets/beta_snippets_test.py | 3 +++ translation/samples/snippets/requirements-test.txt | 1 + 2 files changed, 4 insertions(+) diff --git a/translation/samples/snippets/beta_snippets_test.py b/translation/samples/snippets/beta_snippets_test.py index 4d65c3c2cd6a..ada9e348ba35 100644 --- a/translation/samples/snippets/beta_snippets_test.py +++ b/translation/samples/snippets/beta_snippets_test.py @@ -67,6 +67,7 @@ def test_translate_text(capsys): assert 'Translated Text:' in out +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_batch_translate_text(capsys, bucket): beta_snippets.batch_translate_text( PROJECT_ID, @@ -96,6 +97,7 @@ def test_list_languages_with_target(capsys): assert u'Display Name: albanska' in out +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_create_glossary(capsys, unique_glossary_id): beta_snippets.create_glossary(PROJECT_ID, unique_glossary_id) out, _ = capsys.readouterr() @@ -125,6 +127,7 @@ def test_translate_text_with_glossary(capsys, glossary): assert 'cuenta' in out +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_delete_glossary(capsys, unique_glossary_id): beta_snippets.create_glossary(PROJECT_ID, unique_glossary_id) beta_snippets.delete_glossary(PROJECT_ID, unique_glossary_id) diff --git a/translation/samples/snippets/requirements-test.txt b/translation/samples/snippets/requirements-test.txt index 781d4326c947..c6f9b64965ae 100644 --- a/translation/samples/snippets/requirements-test.txt +++ b/translation/samples/snippets/requirements-test.txt @@ -1 +1,2 @@ +flaky==3.6.1 pytest==5.3.2