File tree 2 files changed +14
-2
lines changed
monitoring/api/v3/uptime-check-client
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change
1
+ backoff===1.10.0
1
2
pytest==5.3.2
Original file line number Diff line number Diff line change 17
17
import random
18
18
import string
19
19
20
+ import backoff
21
+ from google .api_core .exceptions import DeadlineExceeded
20
22
import pytest
21
23
22
24
import snippets
@@ -63,8 +65,17 @@ def test_update_uptime_config(capsys):
63
65
new_display_name = random_name (10 )
64
66
new_uptime_check_path = '/' + random_name (10 )
65
67
with UptimeFixture () as fixture :
66
- snippets .update_uptime_check_config (
67
- fixture .config .name , new_display_name , new_uptime_check_path )
68
+
69
+ # We sometimes see the permission error saying the resource
70
+ # may not exist. Weirdly DeadlineExceeded instnace is raised
71
+ # in this case.
72
+ @backoff .on_exception (backoff .expo , DeadlineExceeded , max_time = 120 )
73
+ def call_sample ():
74
+ snippets .update_uptime_check_config (
75
+ fixture .config .name , new_display_name , new_uptime_check_path )
76
+
77
+ call_sample ()
78
+
68
79
out , _ = capsys .readouterr ()
69
80
snippets .get_uptime_check_config (fixture .config .name )
70
81
out , _ = capsys .readouterr ()
You can’t perform that action at this time.
0 commit comments