Skip to content

Commit 9685dce

Browse files
nicainengelke
andauthored
fix: Improve flaky retry after periodic test suite failure (GoogleCloudPlatform#10068)
Co-authored-by: Charles Engelke <engelke@google.com>
1 parent 2a91ba2 commit 9685dce

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

speech/snippets/adaptation_v2_phrase_set_reference_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import re
1717
from uuid import uuid4
1818

19-
from google.api_core.retry import Retry
19+
import backoff
2020
from google.cloud.speech_v2 import SpeechClient
2121
from google.cloud.speech_v2.types import cloud_speech
2222

@@ -37,7 +37,7 @@ def delete_phrase_set(name):
3737
client.delete_phrase_set(request=request)
3838

3939

40-
@Retry()
40+
@backoff.on_exception(backoff.expo, Exception, max_time=120)
4141
def test_adaptation_v2_phrase_set_reference(capsys):
4242
project_id = os.getenv("GOOGLE_CLOUD_PROJECT")
4343

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
backoff==2.2.1
12
flaky==3.7.0
23
pytest==7.2.2

0 commit comments

Comments
 (0)