Content-Length: 294940 | pFad | http://github.com/googleapis/google-cloud-python/commit/4b8e11bcf4fc91891f35159f9232090c12facd97

07 testing(automl): retry upon InternalServerError [(#4350)](https://git… · googleapis/google-cloud-python@4b8e11b · GitHub
Skip to content

Commit 4b8e11b

Browse files
Takashi Matsuobusunkim96
Takashi Matsuo
authored andcommitted
testing(automl): retry upon InternalServerError [(#4350)](GoogleCloudPlatform/python-docs-samples#4350)
fixes #4343
1 parent 28d13a6 commit 4b8e11b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/google-cloud-automl/samples/snippets/list_operation_status_test.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
import os
1616

17+
import backoff
18+
from google.api_core.exceptions import InternalServerError
1719
import pytest
1820

1921
import list_operation_status
@@ -23,6 +25,11 @@
2325

2426
@pytest.mark.slow
2527
def test_list_operation_status(capsys):
26-
list_operation_status.list_operation_status(PROJECT_ID)
28+
# We saw 500 InternalServerError. Now we just retry few times.
29+
@backoff.on_exception(backoff.expo, InternalServerError, max_time=120)
30+
def run_sample():
31+
list_operation_status.list_operation_status(PROJECT_ID)
32+
33+
run_sample()
2734
out, _ = capsys.readouterr()
2835
assert "Operation details" in out

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/googleapis/google-cloud-python/commit/4b8e11bcf4fc91891f35159f9232090c12facd97

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy