fix: poll for alert resolution in agent channel test
This commit is contained in:
parent
0694f724e1
commit
6cee88c7b3
1 changed files with 7 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue