Skip to content

Commit 03a820f

Browse files
author
Takashi Matsuo
authored
fix(monitoring): retry in the test setup (#4702)
fixes #4687 fixes #4688 fixes #4689 fixes #4690
1 parent cacc0c7 commit 03a820f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

monitoring/api/v3/cloud-client/snippets_test.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import re
1717

1818
import backoff
19+
from google.api_core.exceptions import InternalServerError
1920
from google.api_core.exceptions import NotFound
2021
import pytest
2122

@@ -42,7 +43,12 @@ def custom_metric_descriptor(capsys):
4243

4344
@pytest.fixture(scope="module")
4445
def write_time_series():
45-
snippets.write_time_series(PROJECT_ID)
46+
47+
@backoff.on_exception(backoff.expo, InternalServerError, max_time=120)
48+
def write():
49+
snippets.write_time_series(PROJECT_ID)
50+
51+
write()
4652
yield
4753

4854

0 commit comments

Comments
 (0)