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
test_project_screen reads the clock twice, so «Экземпляр жив» shows 11 minutes on Linux and fails CI #361
server/tests/test_project_screen.py::test_the_screen_shows_each_block (the monitoring branch, #359, written in 749fd6d) fails on every CI run and passes on the owner's Windows machine.
The test takes now = _now() and passes it to the helper _stats(now=now, …). The helper reads the clock a second time for its own now, builds started_at as that second reading minus twelve minutes, and only then lets the test's now override its own. So the instance has lived twelve minutes less the gap between the two readings, and project_render._minutes rounds down: «Экземпляр жив: 11 мин», where the test asks for 12.
Failure scenario: on Linux consecutive datetime.now() calls differ by microseconds, so the gap is never zero and the test fails every time — CI's «Server (API + bot)» on 4cb751a (15:20 UTC, 6 October 2026: 1 failed, 2706 passed) and on 4b0cd19 (16:34 UTC: 1 failed, 2711 passed). On Windows 99,957 of 99,999 consecutive readings were equal on this machine, so the local full runs (2707 and 2712 passed) never saw it. With _now replaced by a clock that advances one microsecond per call, the test fails locally too, alone in its file.
The renderer is right: it counts whole minutes from the instance's start, and a process that has lived 11 min 59.99 s has lived eleven. The defect is the test's helper reading the clock twice. It blocks #359's merge, because CI is red on its head.
Fix, in #359 before it merges: _stats builds started_at from the now it is given, when it is given one, so one test reads one clock. Found by reading CI's log after the push of 4b0cd19.
Activity
Read the clock once in the project screen's test, so CI's Linux agree…
Say in the close-out that CI found #361, and that 5052df1 fixed it