File tree Expand file tree Collapse file tree
test/integration/models/monitor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -189,12 +189,20 @@ def test_integration_create_get_update_delete_alert_definition(
189189 update_alert .label = f"{ label } -updated"
190190 update_alert .save ()
191191
192+ updated = client .load (AlertDefinition , update_alert .id , service_type )
193+ while getattr (updated , "status" , None ) == "in progress" and (time .time () - start ) < timeout :
194+ time .sleep (interval )
195+ try :
196+ updated = client .load (AlertDefinition ,updated .id ,service_type )
197+ except Exception :
198+ # transient errors while polling; continue until timeout
199+ pass
200+
192201 finally :
193202 if created :
194203 # Best-effort cleanup; allow transient errors.
195- alert_update_interval = 120 # max time alert should take to update
204+ # max time alert should take to update
196205 try :
197- time .sleep (alert_update_interval )
198206 delete_alert = client .load (AlertDefinition , created .id , service_type )
199207 delete_alert .delete ()
200208 except Exception :
You can’t perform that action at this time.
0 commit comments