Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

Commit 3bbd5ec

Browse filesBrowse files
Takashi Matsuobusunkim96
authored andcommitted
testing(automl): retry upon InternalServerError [(#4350)](GoogleCloudPlatform/python-docs-samples#4350)
fixes #4343
1 parent 20ad0b8 commit 3bbd5ec
Copy full SHA for 3bbd5ec

File tree

Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed

‎samples/snippets/list_operation_status_test.py

Copy file name to clipboardExpand all lines: samples/snippets/list_operation_status_test.py
+8-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.