Fix flaky tests in MonitoringSupervisor and AlertNotifier
- Add Mox stub setup in supervisor_test.exs to handle DeviceMonitor ping calls - Change alert_notifier_test.exs to async: true to prevent mailbox contamination - All 1066 tests now passing with 0 failures
This commit is contained in:
parent
1dbcbb92f1
commit
f9553b1444
2 changed files with 8 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
defmodule Towerops.Alerts.AlertNotifierTest do
|
||||
use Towerops.DataCase, async: false
|
||||
use Towerops.DataCase, async: true
|
||||
|
||||
import Swoosh.TestAssertions
|
||||
import Towerops.AccountsFixtures
|
||||
|
|
|
|||
|
|
@ -1,12 +1,19 @@
|
|||
defmodule Towerops.Monitoring.SupervisorTest do
|
||||
use Towerops.DataCase, async: false
|
||||
|
||||
import Mox
|
||||
import Towerops.AccountsFixtures
|
||||
|
||||
alias Towerops.Monitoring.PingMock
|
||||
alias Towerops.Monitoring.Supervisor, as: MonitoringSupervisor
|
||||
alias Towerops.Snmp.PollerRegistry
|
||||
|
||||
setup :verify_on_exit!
|
||||
|
||||
setup do
|
||||
# Stub ping calls for any monitors that start during tests
|
||||
# Allow any number of ping calls (monitors ping on init)
|
||||
stub_with(PingMock, Towerops.Monitoring.PingStub)
|
||||
# Start Monitoring.Supervisor for these tests
|
||||
start_supervised!(MonitoringSupervisor)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue