You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sensor import: the first flush sends no heartbeat while the monotonic clock reads under 30 s #768
sensor.Import starts with self.beat = 0.0 and sends a heartbeat only when time.monotonic() - self.beat passes 30 s. So its first flush() sends none while the process's monotonic clock reads under 30 s.
Where it shows
On Linux, time.monotonic() counts from boot: an import started within 30 s of a node's boot (a DaemonSet on a fresh node, say) sends no heartbeat at first, so runs registered in that window aren't covered by one until the next.
On macOS with Python 3.9 the clock starts near 0 in each process, so pytest tests/test_sensor.py run on its own fails 11 tests on main; inside a longer pytest run it passes, which hides it.
A fix
Start beat as None, so the first flush() always sends a heartbeat, and keep the 30 s spacing after it. A regression test: an Import whose clock reads 5 s sends a heartbeat on its first flush.
Found while root-causing the intermittent test_sensor failure in #766.
Activity
sensor import: send the first heartbeat whatever the monotonic clock …