Skip to content

Commit

Permalink
fix(monitoring): retry in the test setup
Browse files Browse the repository at this point in the history
fixes #4687
fixes #4688
fixes #4689
fixes #4690
  • Loading branch information
Takashi Matsuo committed Sep 17, 2020
1 parent 50f9632 commit 57ff5dc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion monitoring/api/v3/cloud-client/snippets_test.py
Expand Up @@ -17,6 +17,7 @@

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

import snippets
Expand All @@ -42,7 +43,12 @@ def custom_metric_descriptor(capsys):

@pytest.fixture(scope="module")
def write_time_series():
snippets.write_time_series(PROJECT_ID)

@backoff.on_exception(backoff.expo, InternalServerError, max_time=120)
def write():
snippets.write_time_series(PROJECT_ID)

write()
yield


Expand Down

0 comments on commit 57ff5dc

Please sign in to comment.