diff --git a/test/towerops/workers/device_monitor_worker_test.exs b/test/towerops/workers/device_monitor_worker_test.exs index 8f01b8f0..78f8f9c8 100644 --- a/test/towerops/workers/device_monitor_worker_test.exs +++ b/test/towerops/workers/device_monitor_worker_test.exs @@ -47,7 +47,8 @@ defmodule Towerops.Workers.DeviceMonitorWorkerTest do # Calculate the delay (scheduled_at - inserted_at) delay_seconds = DateTime.diff(job.scheduled_at, job.inserted_at, :second) - assert delay_seconds == expected_offset + # Allow 1 second tolerance for timing variations during test execution + assert delay_seconds in (expected_offset - 1)..(expected_offset + 1) end test "offset is within monitor interval bounds", %{site: site} do