Repository navigation
Tests: fail grouped tests by name when --dist loadgroup stops grouping (pytest 9.2) - #15638
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
studio/backend/tests/test_mcp_session_cache_reset_between_tests.py::test_the_next_test_starts_with_an_empty_cache_and_the_session_closedhas failed on the(Python 3.13, g-r)shard of #15587, #15593, #15601 and #15615 (assert 0 == 1on_Session.closed).Root cause
CI now resolves pytest 9.2.0, and pytest-xdist 3.8.0 (the latest release) does not work with it:
--dist loadgroupkeeps anxdist_groupon one worker by rewritingitem._nodeidto<id>@<group>.Item.nodeidfrom a structured_idinstead, so that write is lost.The MCP pair (and the other
*_reset_between_testspairs) only hold when both tests run on the same worker. With-v, the first test ran ongw0and the second ongw3.Minimal reproduction:
pytest -n 2 --dist loadgroup -v:test_one@g1andtest_two@g1, both ongw0.test_oneongw0andtest_twoongw1.The same pytest release is behind the
torch._dynamo.config.* does not existfailures (#15624 pins Backend CI below 9.2 for that; #15626 makes the suite tolerate it).Change
This builds on #15624 (merged), which pins
'pytest<9.2'instudio-backend-ci.yml, the only workflow that runs--dist loadgroup.version-compat-ci.yml:'pytest>=8'becomes'pytest>=8,<9.2'. These lanes run the CPU-spoof fixtures that monkeypatchtorch._dynamo.config, which pytest 9.2 deletes on undo.tests/_shared/xdist_group_check.py, installed as atrylastpytest_collection_modifyitemshook intests/conftest.pyandstudio/backend/tests/conftest.py:--dist loadgroup, any test that carries anxdist_groupmark but whose node id has no@grouptag now fails with the reason.INTERNALERROR, so each affected test fails individually instead.tests/test_xdist_group_check.py: unit tests for the check, the conftest wiring, and both pins (Backend CI from Backend CI: pin pytest below 9.2 #15624 and version-compat from this PR).Testing
Run on
studio/backend/tests/test_mcp_*.pywith-n 4 --dist loadgroup:With the check in place, the two grouped pair files under
-n 2 --dist loadgroup:tests/test_xdist_group_check.pywithtests/test_torch_config_guard.py(from #15626) after merging main: 18 passed.