Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

Commit

Permalink
fix(monitoring): retry in the test setup [(#4702)](GoogleCloudPlatfor…
Browse files Browse the repository at this point in the history
…m/python-docs-samples#4702)

fixes #4687
fixes #4688
fixes #4689
fixes #4690
  • Loading branch information
Takashi Matsuo authored Sep 18, 2020
1 parent 43f7160 commit 46ac39b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion samples/snippets/v3/cloud-client/snippets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import re

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

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 46ac39b

Please sign in to comment.