Skip to content

test: latest_per sibling test no longer ties on a one-second completion stamp - #1759

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/latest-per-test-tie
Nov 2, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/latest-per-test-tie

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

This fixes a flaky test that turned PyAutoFit main red at 963ff296a (Tests run 41456192737, unittest-nojax leg) and so blocked the release-validation preflight (closes #1758).

test_latest_per_keeps_the_latest_sibling runs two tiny fits back to back and expects Aggregator.latest_per() to keep the second. The status record stamps completion to the second (%Y-%m-%dT%H:%M:%SZ), so both fits often finished "at the same time". latest_per then broke the tie by path, an identifier hash, and the test passed or failed by chance. It failed 1 of the last 15 Tests runs.

The fix backdates the first fit's status stamp by one minute after the fits run. Every assertion is kept. The library behaviour is unchanged and correct: an exact tie is resolved deterministically, and real reruns are minutes apart.

API Changes

None (test-only).

Test Plan

  • The test 20× in a row: 20 passed, 0 failed.
  • test_autofit/results: 58 passed.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

…on stamp

Status records stamp completion to the second, so the test's two small fits
often finished in the same second and latest_per kept either by path. Backdate
the first fit's stamp a minute so the second is unambiguously the later.

Fixes #1758

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Nov 2, 2026
@Jammy2211
Jammy2211 merged commit dbf05d7 into main Nov 2, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/latest-per-test-tie branch November 2, 2026 18:08
@pyautolabs-bot pyautolabs-bot Bot removed the pending-release PR queued for the next release build label Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: test_latest_per_keeps_the_latest_sibling flakes on a one-second completion tie

1 participant