From 6264ad62138948611b9fbef51a1c5406c861ed99 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Mon, 20 Apr 2020 18:10:15 -0700 Subject: [PATCH] [vision] fix: longer timeout [(#3447)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/3447) fixes #2962 --- samples/snippets/detect/detect.py | 2 +- samples/snippets/detect/detect_test.py | 2 ++ samples/snippets/detect/requirements-test.txt | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/samples/snippets/detect/detect.py b/samples/snippets/detect/detect.py index a7d3eca8..a3976ffb 100644 --- a/samples/snippets/detect/detect.py +++ b/samples/snippets/detect/detect.py @@ -836,7 +836,7 @@ def async_detect_document(gcs_source_uri, gcs_destination_uri): requests=[async_request]) print('Waiting for the operation to finish.') - operation.result(timeout=180) + operation.result(timeout=300) # Once the request has completed and the output has been # written to GCS, we can list all the output files. diff --git a/samples/snippets/detect/detect_test.py b/samples/snippets/detect/detect_test.py index 5a8774c1..e577df75 100644 --- a/samples/snippets/detect/detect_test.py +++ b/samples/snippets/detect/detect_test.py @@ -16,6 +16,7 @@ import uuid from google.cloud import storage +import pytest import detect @@ -208,6 +209,7 @@ def test_detect_crop_hints_uri(capsys): assert 'bounds: ' in out +@pytest.mark.flaky def test_async_detect_document(capsys): storage_client = storage.Client() bucket = storage_client.get_bucket(BUCKET) diff --git a/samples/snippets/detect/requirements-test.txt b/samples/snippets/detect/requirements-test.txt index 781d4326..1b569cb4 100644 --- a/samples/snippets/detect/requirements-test.txt +++ b/samples/snippets/detect/requirements-test.txt @@ -1 +1,2 @@ pytest==5.3.2 +flaky==3.6.1