Skip to content

Commit a091f0f

Browse files
author
Takashi Matsuo
committed
[vision] fix: add timeout for LRO result and mark it as flaky
fixes GoogleCloudPlatform#3674
1 parent 4d4147d commit a091f0f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

vision/cloud-client/detect/vision_async_batch_annotate_images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def sample_async_batch_annotate_images(
4646
operation = client.async_batch_annotate_images(requests, output_config)
4747

4848
print("Waiting for operation to complete...")
49-
response = operation.result()
49+
response = operation.result(90)
5050

5151
# The output is written to GCS with the provided output_uri as prefix
5252
gcs_output_uri = response.output_config.gcs_destination.uri

vision/cloud-client/detect/vision_async_batch_annotate_images_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def bucket(storage_client):
4949
blob.delete()
5050

5151

52+
@pytest.mark.flaky(max_runs=3, min_passes=1)
5253
def test_sample_asyn_batch_annotate_images(storage_client, bucket, capsys):
5354
input_image_uri = os.path.join(GCS_ROOT, "label/wakeupcat.jpg")
5455

0 commit comments

Comments
 (0)