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
fix: test_latest_per_keeps_the_latest_sibling flakes on a one-second completion tie #1758
test_autofit/results/test_identity.py::test_latest_per_keeps_the_latest_sibling failed on main at 963ff296a (Tests run 41456192737, unittest-nojax leg). That failure blocks the release-validation preflight ("PyAutoFit: CI failure").
The test runs two tiny fits of the same search back to back, then expects Aggregator.latest_per() to keep the second. completed_at comes from the status record's updated stamp, which has one-second resolution (%Y-%m-%dT%H:%M:%SZ, autofit/non_linear/status/record.py::_now). When both fits finish within the same second they tie, and latest_per breaks the tie by the greater path, which is an identifier hash. So the test passes or fails by chance. It failed 1 of the last 15 Tests runs.
That tie behaviour is correct: it's deterministic, and real reruns are minutes apart. The bug is in the test.
Plan
Test-only fix: after the three fits, rewrite the first fit's <output_path>.status.jsonupdated to one minute earlier, so the second fit is unambiguously the later sibling whatever the clock does.
test_autofit/results/test_identity.py::test_latest_per_keeps_the_latest_sibling: capture first = _fit(...), then load its status JSON, set updated to second's minus 60 s, and write it back before building the aggregator. Keep every existing assertion.
Run the test 20× under -p no:randomly, plus the results folder and the nojax-emulated leg.
Original Prompt
Click to expand
Human 2026-11-02: "Fix, then validate" (after release validate preflight was blocked by this failure).
Activity
Jammy2211 commentedon Nov 2, 2026
Library PR Created: #1759 (test-only; 20/20 passes). Merge it, then
release validatecan run (its preflight is blocked by this red main).Jammy2211 commentedon Nov 2, 2026
Shipped. #1759 merged — the latest_per sibling test no longer depends on two fits finishing in different seconds.