Skip to content

tests: guard xdist collection determinism (Part of #6255) - #6257

Merged
squid-protocol merged 1 commit into
mainfrom
churn/6255-20261023T1548Z
Oct 23, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
churn/6255-20261023T1548Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #6255 (not Closes: the issue closes itself when the gate next succeeds on main).

Diagnosis. Run 39975956333 (main @ 97a8a40): only the windows-latest / 3.11 part failed, with 3 xdist collection errors ("Different tests were collected between gw2 and gwN"). Cause: test_checkpoint_extensions_need_a_model_header ids embedded raw zip bytes whose DOS timestamp was "now". Real defect, not an infra flake. Already fixed on main by #6252 (_zip pins date_time), which landed after the failing run.

This PR (regression guard). tests/core_engine/test_collection_determinism_6255.py:

  • slice4._zip bytes are identical under a shifted clock.
  • AST scan of every tests/**/test_*.py: no parametrize argument may call a clock/random/uuid/tempfile/pid API.

Class sweep. Other zip builders (test_model_magic.py) build lazily with explicit string ids=; test_galaxyscope.py only patches ZipFile. No other instance found.

Gates. plain pytest from /tmp passes (2 tests, 1.5 s); ruff format clean; tests/tools/audit_check.py all clear. No engine files touched, no golden bless.

Cross-repo. None.

Lessons for agents

  • A parametrize value whose repr ends up in the test id (raw bytes) must be deterministic across processes, or xdist aborts collection on that worker; give lazily-built payloads explicit ids=.

🤖 Generated with Claude Code

…6255

The windows 3.11 full-suite part died on "Different tests were collected" because a zip probe id carried a wall-clock timestamp (fixed in #6252). Pin that helper's bytes against the clock and fail any parametrize argument that calls a clock/random/uuid/tmp/pid API.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 23, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 23, 2026 15:53
@squid-protocol
squid-protocol enabled auto-merge (squash) October 23, 2026 15:53
@squid-protocol
squid-protocol merged commit 15022cc into main Oct 23, 2026
44 checks passed
@squid-protocol
squid-protocol deleted the churn/6255-20261023T1548Z branch October 23, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant