Repository navigation
DM-56905: Fix Periodic CI for pytest 9.2 and ruff 0.17 - #884
Merged
Merged
Conversation
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.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The weekly Periodic CI
testjob 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 bymake update-deps:testsession — pytest 9.2.0 breaks--dist=loadgroupin pytest-xdist 3.8.0. pytest 9.2.0 (released 2026-10-27) keeps a node's ID in a structuredNode._idand no longer reads the privateItem._nodeidattribute. pytest-xdist 3.8.0 implementsloadgroupby rewriting that attribute, so thexdist_groupmark is now silently ignored and tests are scheduled as with--dist=load. The paired pins intests/session_lifespan_test.pyrely on running on one worker in file order; split across workers,test_lifespan_engine_is_sharedandtest_arq_queue_is_rebuilt_per_testfail withIndexError: list index out of range. This is fixed on pytest-xdist's master branch (--dist=loadgroupsilently 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.lintsession — 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 intests/conftest.pythat were wrapped only because of their# noqa: E402comment are flagged (and auto-fixed).Changes
pytest<9.2cap to thedevdependency 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 loadgroupsetup 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.make update(uv.lock, ruff pre-commit hook 0.16.10 → 0.17.4, uv 0.13.4 → 0.13.7).tests/conftest.py.No changelog fragment: this only touches development dependencies, test code, and CI pins, in line with previous "Update dependencies" changes.
Validation
mainaftermake update(same twoIndexErrortest failures; same I001 lint failure).xdist_grouptest 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 oldconftest.pyand 0.17.0 rejects it.nox -s lint typing testpasses (4283 tests), as doclient_testanddeploy_worker_test.