fix: poll for alert resolution in agent channel test

This commit is contained in:
Graham McIntire 2026-03-08 09:20:50 -05:00
parent 0694f724e1
commit 6cee88c7b3
No known key found for this signature in database

View file

@ -1013,8 +1013,13 @@ defmodule ToweropsWeb.AgentChannelTest do
assert updated_device.status == :up
# Verify device_down alert was auto-resolved
updated_alert = Towerops.Alerts.get_alert(alert.id)
# Verify device_down alert was auto-resolved (poll for it since it happens asynchronously)
updated_alert =
poll_until(fn ->
alert = Towerops.Alerts.get_alert(alert.id)
if alert && alert.resolved_at, do: alert
end)
assert updated_alert.resolved_at
# Verify device_up alert was created