File tree 1 file changed +6
-3
lines changed
monitoring/api/v3/alerts-client
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -118,20 +118,23 @@ def test_list_alert_policies(capsys, pochan):
118
118
assert pochan .alert_policy .display_name in out
119
119
120
120
121
- @pytest .mark .flaky (rerun_filter = delay_on_aborted , max_runs = 5 )
122
121
def test_enable_alert_policies (capsys , pochan ):
122
+ @retry (wait_exponential_multiplier = 1000 , wait_exponential_max = 10000 ,
123
+ stop_max_attempt_number = 5 , retry_on_exception = retry_if_aborted )
124
+ def invoke_sample (val ):
125
+ snippets .enable_alert_policies (pochan .project_name , val )
123
126
# These sleep calls are for mitigating the following error:
124
127
# "409 Too many concurrent edits to the project configuration.
125
128
# Please try again."
126
129
# Having multiple projects will void these `sleep()` calls.
127
130
# See also #3310
128
131
time .sleep (2 )
129
- snippets . enable_alert_policies ( pochan . project_name , True )
132
+ invoke_sample ( True )
130
133
out , _ = capsys .readouterr ()
131
134
assert "Enabled {0}" .format (pochan .project_name ) in out
132
135
133
136
time .sleep (2 )
134
- snippets . enable_alert_policies ( pochan . project_name , False )
137
+ invoke_sample ( False )
135
138
out , _ = capsys .readouterr ()
136
139
assert "Disabled {}" .format (pochan .project_name ) in out
137
140
You can’t perform that action at this time.
0 commit comments