fix: add 1-second tolerance to device monitor worker offset test
This commit is contained in:
parent
1b5b8c1257
commit
c133296ce6
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue