fix: add 1-second tolerance to device monitor worker offset test

This commit is contained in:
Graham McIntire 2026-03-08 15:42:32 -05:00
parent 1b5b8c1257
commit c133296ce6
No known key found for this signature in database

View file

@ -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