Skip to content

Commit fe0dfe7

Browse files
partheadandhlee
authored andcommitted
chore: attempt to fix flaky snippet test test_list_alert_policies (#167)
Fixes #149 🦕
1 parent 79c5e54 commit fe0dfe7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

monitoring/snippets/v3/alerts-client/snippets_test.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,16 @@ def pochan():
123123

124124

125125
def test_list_alert_policies(capsys, pochan):
126-
# Query snippets.list_alert_policies() for up to 5 seconds
126+
# Query snippets.list_alert_policies() for up to 50 seconds
127127
# to allow the newly created policy to appear in the list.
128128
retry = 5
129129
while retry:
130130
snippets.list_alert_policies(pochan.project_name)
131131
out, _ = capsys.readouterr()
132-
# Only check up to the first 20 characters of the display name
133-
# as long strings printed to the console are truncated.
134-
if pochan.alert_policy.display_name[0:20] in out:
132+
if pochan.alert_policy.display_name in out:
135133
break
136134
retry = retry - 1
137-
time.sleep(1)
135+
time.sleep(10)
138136

139137
assert retry > 0
140138

0 commit comments

Comments
 (0)