Skip to content

Commit e459ac8

Browse files
committed
Updated integration test
1 parent b626bf9 commit e459ac8

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

test/integration/models/monitor/test_monitor.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff 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:

0 commit comments

Comments
 (0)