Skip to content

Commit

Permalink
testing(automl): retry upon InternalServerError [(#4350)](#4350)
Browse files Browse the repository at this point in the history
fixes #4343
  • Loading branch information
Takashi Matsuo authored and dandhlee committed Nov 17, 2022
1 parent c796c87 commit df43d6c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion automl/snippets/list_operation_status_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

import os

import backoff
from google.api_core.exceptions import InternalServerError
import pytest

import list_operation_status
Expand All @@ -23,6 +25,11 @@

@pytest.mark.slow
def test_list_operation_status(capsys):
list_operation_status.list_operation_status(PROJECT_ID)
# We saw 500 InternalServerError. Now we just retry few times.
@backoff.on_exception(backoff.expo, InternalServerError, max_time=120)
def run_sample():
list_operation_status.list_operation_status(PROJECT_ID)

run_sample()
out, _ = capsys.readouterr()
assert "Operation details" in out

0 comments on commit df43d6c

Please sign in to comment.