From 022ae3d33dd88f65d36caa02d36793211925bd18 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Sat, 17 Oct 2026 16:00:02 +0000 Subject: [PATCH 1/2] build(deps): Prep pytest-xdist 3.8.0 bump, drop pytest-workaround-12888 pytest 9.0.3 already imports readline early in _pytest/capture.py (_readline_workaround, pytest-dev/pytest#13176), so the .pth-based workaround for pytest-dev/pytest#12888 is redundant. pytest-xdist 3.5+ reorders --dist=loadfile work units by test count by default. Opt out from the shared sentry pytest plugin so file order and worker assignment stay identical after the bump (covers getsentry too). Co-Authored-By: Joshua Li <14209781+joshuarli@users.noreply.github.com> --- pyproject.toml | 1 - src/sentry/testutils/pytest/sentry.py | 7 +++++++ uv.lock | 10 ---------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f01272abb6c0..ce09cd8a845c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -186,7 +186,6 @@ dev = [ "pytest-json-report>=1.5.0", "pytest-rerunfailures>=16.2", "pytest-sentry>=0.3.0", - "pytest-workaround-12888>=1.0.0", "pytest-xdist>=3.0.2", "responses>=0.23.1", "ruff>=0.14.0", diff --git a/src/sentry/testutils/pytest/sentry.py b/src/sentry/testutils/pytest/sentry.py index afef9d767fce..42adae31b326 100644 --- a/src/sentry/testutils/pytest/sentry.py +++ b/src/sentry/testutils/pytest/sentry.py @@ -159,6 +159,13 @@ def pytest_configure(config: pytest.Config) -> None: category=UnsupportedBackend, ) + # pytest-xdist 3.5+ sorts --dist=loadfile/loadscope work units by test count + # by default. Keep collection order so worker assignment and run order stay + # as they were (and SENTRY_SHUFFLE_TESTS ordering isn't overridden), since + # some unresolved flakes depend on it. + if hasattr(config.option, "loadscopereorder"): + config.option.loadscopereorder = False + config.addinivalue_line("markers", "migrations: requires --migrations") config.addinivalue_line("markers", "symbolicator: test requires access to symbolicator") diff --git a/uv.lock b/uv.lock index 090b7d96c9da..081c9d3b6fc2 100644 --- a/uv.lock +++ b/uv.lock @@ -1889,14 +1889,6 @@ wheels = [ { url = "https://pypi.devinfra.sentry.io/wheels/pytest_sentry-0.3.0-py3-none-any.whl", hash = "sha256:ae182f11c18179533d4d760fd79f1992cc351062e69d253297a4cc7639535db7" }, ] -[[package]] -name = "pytest-workaround-12888" -version = "1.0.0" -source = { registry = "https://pypi.devinfra.sentry.io/simple" } -wheels = [ - { url = "https://pypi.devinfra.sentry.io/wheels/pytest_workaround_12888-1.0.0-py3-none-any.whl", hash = "sha256:eacf051c4668958243339d06786efcbec7659cf2d2074942dc559b6f3090a811" }, -] - [[package]] name = "pytest-xdist" version = "3.0.2" @@ -2337,7 +2329,6 @@ dev = [ { name = "pytest-json-report" }, { name = "pytest-rerunfailures" }, { name = "pytest-sentry" }, - { name = "pytest-workaround-12888" }, { name = "pytest-xdist" }, { name = "responses" }, { name = "ruff" }, @@ -2510,7 +2501,6 @@ dev = [ { name = "pytest-json-report", specifier = ">=1.5.0" }, { name = "pytest-rerunfailures", specifier = ">=16.2" }, { name = "pytest-sentry", specifier = ">=0.3.0" }, - { name = "pytest-workaround-12888", specifier = ">=1.0.0" }, { name = "pytest-xdist", specifier = ">=3.0.2" }, { name = "responses", specifier = ">=0.23.1" }, { name = "ruff", specifier = ">=0.14.0" }, From 136239ebe391387811f2c0a43df2ee4db8aee197 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Sat, 17 Oct 2026 16:15:02 +0000 Subject: [PATCH 2/2] build(deps): Bump pytest-xdist to 3.8.0 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 <14209781+joshuarli@users.noreply.github.com> --- pyproject.toml | 2 +- uv.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ce09cd8a845c..6f7b5d71d346 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -186,7 +186,7 @@ dev = [ "pytest-json-report>=1.5.0", "pytest-rerunfailures>=16.2", "pytest-sentry>=0.3.0", - "pytest-xdist>=3.0.2", + "pytest-xdist>=3.8.0", "responses>=0.23.1", "ruff>=0.14.0", "selenium>=4.16.0", diff --git a/uv.lock b/uv.lock index 081c9d3b6fc2..b70cf32e6b04 100644 --- a/uv.lock +++ b/uv.lock @@ -492,10 +492,10 @@ wheels = [ [[package]] name = "execnet" -version = "1.9.0" +version = "2.1.2" source = { registry = "https://pypi.devinfra.sentry.io/simple" } wheels = [ - { url = "https://pypi.devinfra.sentry.io/wheels/execnet-1.9.0-py2.py3-none-any.whl", hash = "sha256:a295f7cc774947aac58dde7fdc85f4aa00c42adf5d8f5468fc630c1acf30a142" }, + { url = "https://pypi.devinfra.sentry.io/wheels/execnet-2.1.2-py3-none-any.whl", hash = "sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec" }, ] [[package]] @@ -1891,14 +1891,14 @@ wheels = [ [[package]] name = "pytest-xdist" -version = "3.0.2" +version = "3.8.0" source = { registry = "https://pypi.devinfra.sentry.io/simple" } dependencies = [ { name = "execnet" }, { name = "pytest" }, ] wheels = [ - { url = "https://pypi.devinfra.sentry.io/wheels/pytest_xdist-3.0.2-py3-none-any.whl", hash = "sha256:9feb9a18e1790696ea23e1434fa73b325ed4998b0e9fcb221f16fd1945e6df1b" }, + { url = "https://pypi.devinfra.sentry.io/wheels/pytest_xdist-3.8.0-py3-none-any.whl", hash = "sha256:202ca578cfeb7370784a8c33d6d05bc6e13b4f25b5053c30a152269fd10f0b88" }, ] [[package]] @@ -2501,7 +2501,7 @@ dev = [ { name = "pytest-json-report", specifier = ">=1.5.0" }, { name = "pytest-rerunfailures", specifier = ">=16.2" }, { name = "pytest-sentry", specifier = ">=0.3.0" }, - { name = "pytest-xdist", specifier = ">=3.0.2" }, + { name = "pytest-xdist", specifier = ">=3.8.0" }, { name = "responses", specifier = ">=0.23.1" }, { name = "ruff", specifier = ">=0.14.0" }, { name = "selenium", specifier = ">=4.16.0" },