Skip to content

chore(packages): add pytest-xdist 3.8.0, execnet 2.1.2 - #2626

Merged
joshuarli merged 1 commit into
mainfrom
joshua/add-pytest-xdist-3.8.0
Oct 17, 2026
Merged

joshuarli merged 1 commit into
mainfrom
joshua/add-pytest-xdist-3.8.0

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Adds pytest-xdist==3.8.0 (latest) and its new minimum dependency execnet==2.1.2 to packages.ini. getsentry/sentry needs them to bump pytest-xdist from 3.0.2: getsentry/sentry#127938.

  • I used python3 -m add_pkg --skip-resolve pytest-xdist==3.8.0 execnet==2.1.2. Both are pure-Python py3-none-any wheels, and no build options are needed.
  • Dependencies: pytest-xdist 3.8.0 requires execnet>=2.1 (added here) and pytest>=7.0.0 (already listed, up to 9.0.3). execnet 2.1.2 has no runtime dependencies.
  • Existing versions are kept, and no published wheels are touched.

via @joshuarli.

--

View Junior Session [Sentry]

@joshuarli
joshuarli marked this pull request as ready for review October 17, 2026 16:05
@joshuarli
joshuarli merged commit 034eae4 into main Oct 17, 2026
19 checks passed
@joshuarli
joshuarli deleted the joshua/add-pytest-xdist-3.8.0 branch October 17, 2026 16:05
sentry-junior Bot added a commit to getsentry/sentry that referenced this pull request Oct 17, 2026
Pulls in execnet 2.1.2 (xdist 3.6+ requires execnet>=2.1). Both are served by
the internal index after getsentry/pypi#2626.

Co-Authored-By: Joshua Li <[email protected]>
joshuarli added a commit to getsentry/sentry that referenced this pull request Oct 17, 2026
…#127938)

Bumps `pytest-xdist` 3.0.2 → 3.8.0 (latest), and with it `execnet` 1.9.0
→ 2.1.2. Also removes the `pytest-workaround-12888` dev dependency and
keeps xdist's `--dist=loadfile` ordering exactly as it was.

**Bump is done.** getsentry/pypi#2626 mirrored `pytest-xdist==3.8.0` and
`execnet==2.1.2` to internal PyPI (`pypi.devinfra.sentry.io`). The bump
comes from that index via `[email protected] add --dev "pytest-xdist>=3.8.0"`,
the same command `tools/bump_version.py` runs in the `bump-version`
workflow. It's applied on this branch rather than through a separate
workflow PR so it lands together with the ordering guard below. No
public index or override was added, and the lock's wheel hashes match
the upstream release artifacts.

### Removing `pytest-workaround-12888`
The package was only a `.pth` file that ran `import readline` early, to
work around pytest-dev/pytest#12888. pytest-dev/pytest#13176 fixed that
upstream, and pytest 9.0.3 (our locked version) already calls
`_readline_workaround()` from `_pytest/capture.py` in
`pytest_load_initial_conftests`. Nothing else in the repo refers to it.

### Keeping test ordering the same (`--dist=loadfile`)
Starting in **xdist 3.5.0** (pytest-dev/pytest-xdist#632),
`LoadScopeScheduling` sorts work units by test count, largest first,
before handing them out. `LoadFileScheduling` subclasses it, so
`--dist=loadfile` is affected too, and this is on by default. On its
own, the bump would change the order files are handed to workers. That
changes which files share a worker and the order they run in. It would
also override the `SENTRY_SHUFFLE_TESTS` ordering.

**xdist 3.8.0** (pytest-dev/pytest-xdist#1083) added
`--no-loadscope-reorder` to turn this off. This PR sets the same thing
(`config.option.loadscopereorder = False`) in
`sentry.testutils.pytest.sentry:pytest_configure`, so the work queue
keeps collection order exactly as it did on 3.0.2. getsentry loads the
same plugin, so it's covered too. `--dist=loadfile` and how we pick
worker counts are not changed.

I checked the rest of the scheduler diff between 3.0.2 and 3.8.0
(`scheduler/loadscope.py`, `scheduler/loadfile.py`). Apart from the
reorder, the changes are typing and switching `OrderedDict` to plain
`dict`. Insertion order is kept, and dropping extra nodes still pops the
last node. File scoping in `_split_scope` is unchanged. `testrunuid` is
still `uuid4().hex` per run, so the deterministic
`PYTEST_XDIST_TESTRUNUID`-seeded cell name works the same.

### xdist 3.0.2 → 3.8.0 changes that matter for our CI (`-n 2/3
--dist=loadfile`)
- **3.4.0** #963: when a run stops early, the controller waits for
workers to finish reporting. Results from in-progress tests are no
longer dropped, so timeout and `--maxfail` output gets more useful.
- **3.5.0** #632: the loadscope/loadfile reorder. Neutralized here, see
above.
- **3.6.0** #1027 / #620: workers always run tests in the main thread
(execnet `main_thread_only` execmodel). Before this, execnet could run
tests in a non-main thread.
- **3.6.0** #1024: workers now honor `shouldstop`/`shouldfail` (for
example `--maxfail`) instead of running more tests before the controller
stops them.
- **3.6.0** #1028: fixes looponfail with editable installs. Only matters
locally, since we set `looponfailroots`.
- **3.6.1** #1071: fixes a deadlock between execnet's `main_thread_only`
model and pytest-cov reading `rinfo`. Relevant to the coverage jobs
(`pytest-cov` 4.0.0).
- **3.3.1** #907: no remote calls during worker startup, to avoid
scheduling the worker into a non-main thread.
- Requirements: `execnet>=2.1` (1.9.0 → 2.1.2) and `pytest>=7`. We're on
pytest 9.0.3 and Python 3.13. 3.7.0 adds official 3.13 support.

Things that stay the same:
- The `pytest_xdist_setupnodes` hookspec.
- `PYTEST_XDIST_WORKER` / `PYTEST_XDIST_TESTRUNUID` /
`PYTEST_XDIST_WORKER_COUNT`, still set in `xdist/remote.py`.
- The `--looponfail`/`looponfailroots` and `--rsyncdir` deprecation
warnings: same text, so the existing `filterwarnings` entries still
match.

Other changes in this range don't touch the code paths we use
(`--dist=loadfile`, `-n`), and no scheduling options are adopted or
proposed.

### Verification (local, env synced from this branch's `uv.lock` via
internal PyPI)
- `pytest -n 3 --dist=loadfile --reuse-db -q tests/sentry/api/bases/`:
159 passed, with the workaround package uninstalled.
- Ordering: with `-n 1 --dist=loadfile` on `tests/sentry/api/bases/`,
files ran in collection order (`test_organization` 64 tests,
`test_organization_events` 10, `test_organizationmember` 8,
`test_project` 44, `test_team` 33), not sorted by size. A synthetic
suite gave the same order on 3.0.2, on 3.8.0 + `--no-loadscope-reorder`,
and on 3.8.0 + the plugin pin. Plain 3.8.0 reordered it.
- getsentry `tests/getsentry/test_features.py` with `-n 2
--dist=loadfile`: 121 passed, with and without `-W
ignore::DeprecationWarning:xdist.plugin`. Checked earlier against the
same xdist/execnet versions.
- `prek run` and mypy are clean.

<!-- junior-request-attribution:start -->
via @joshuarli.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A1bfddd839102d87ccaa915f25787e8b9 -->

--

[View Junior
Session](https://junior-prod.sentry.dev/conversations/agent%3A1bfddd839102d87ccaa915f25787e8b9)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A1bfddd839102d87ccaa915f25787e8b9/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Joshua Li <[email protected]>
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