Skip to content

DM-56905: Fix Periodic CI for pytest 9.2 and ruff 0.17 - #884

Merged
jonathansick merged 3 commits into
mainfrom
tickets/DM-56905
Nov 10, 2026
Merged

jonathansick merged 3 commits into
mainfrom
tickets/DM-56905

Conversation

@jonathansick

Copy link
Copy Markdown
Member

Summary

The weekly Periodic CI test job has failed on its last two runs (2026-11-02 and 2026-11-09) for two independent reasons, both caused by upstream releases picked up by make update-deps:

  • test session — pytest 9.2.0 breaks --dist=loadgroup in pytest-xdist 3.8.0. pytest 9.2.0 (released 2026-10-27) keeps a node's ID in a structured Node._id and no longer reads the private Item._nodeid attribute. pytest-xdist 3.8.0 implements loadgroup by rewriting that attribute, so the xdist_group mark is now silently ignored and tests are scheduled as with --dist=load. The paired pins in tests/session_lifespan_test.py rely on running on one worker in file order; split across workers, test_lifespan_engine_is_shared and test_arq_queue_is_rebuilt_per_test fail with IndexError: list index out of range. This is fixed on pytest-xdist's master branch (--dist=loadgroup silently stops grouping on pytest main: the nodeid mutation no longer takes effect pytest-dev/pytest-xdist#1386) but there is no release newer than 3.8.0 yet.
  • lint session — ruff 0.17 changes isort wrapping. ruff 0.17.0 no longer counts a trailing pragma comment toward the line length when I001 decides whether an import fits on one line, so five imports in tests/conftest.py that were wrapped only because of their # noqa: E402 comment are flagged (and auto-fixed).

Changes

  • Add a temporary pytest<9.2 cap to the dev dependency group, with a comment pointing at the upstream issue. This is an upper-bound pin rather than a code change because the tests and the nox --dist loadgroup setup are correct; the incompatibility is entirely between pytest and the released pytest-xdist. The cap should be removed once a pytest-xdist release newer than 3.8.0 is available.
  • Update dependencies with make update (uv.lock, ruff pre-commit hook 0.16.10 → 0.17.4, uv 0.13.4 → 0.13.7).
  • Apply ruff 0.17's import re-sort to tests/conftest.py.

No changelog fragment: this only touches development dependencies, test code, and CI pins, in line with previous "Update dependencies" changes.

Validation

  • Reproduced both failures locally on main after make update (same two IndexError test failures; same I001 lint failure).
  • Confirmed the trigger with a minimal xdist_group test under pytest-xdist 3.8.0: grouped onto one worker with pytest 9.1.1, spread across workers with pytest 9.2.0. Confirmed ruff 0.16.10 accepts the old conftest.py and 0.17.0 rejects it.
  • On this branch: nox -s lint typing test passes (4283 tests), as do client_test and deploy_worker_test.

pytest 9.2.0 stores a node's ID in a structured Node._id and no longer
reads the private Item._nodeid attribute. pytest-xdist 3.8.0 implements
--dist=loadgroup by rewriting that attribute, so under pytest 9.2 the
xdist_group mark is silently ignored and tests are scheduled as with
--dist=load. The paired pins in tests/session_lifespan_test.py then run
on different workers and fail with an IndexError, which is what broke
Periodic CI.

The fix is merged in pytest-xdist (pytest-dev/pytest-xdist#1386) but
not released, so cap pytest in the dev dependency group until it is.
ruff 0.17 no longer counts a trailing pragma comment toward the line
length when isort (I001) decides whether an import fits on one line, so
the imports in tests/conftest.py that were wrapped only because of
their noqa: E402 comment are now joined.
@jonathansick
jonathansick merged commit 033b352 into main Nov 10, 2026
26 checks passed
@jonathansick
jonathansick deleted the tickets/DM-56905 branch November 10, 2026 19:40
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.

1 participant