Skip to content

Authenticate xdist StatusDB connections - #358

Merged
icemac merged 6 commits into
pytest-dev:masterfrom
janmrow:authenticate-statusdb
Sep 1, 2026
Merged

Authenticate xdist StatusDB connections#358
icemac merged 6 commits into
pytest-dev:masterfrom
janmrow:authenticate-statusdb

Conversation

@janmrow

@janmrow janmrow commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Generate a per-session token on the xdist controller and pass it to workers through workerinput.

StatusDB now requires a successful handshake before processing commands and rejects clients with an invalid token.

Tests cover the authentication check and passing the connection details to workers.

@janmrow
janmrow marked this pull request as ready for review August 27, 2026 15:33

@icemac icemac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the handshake against the branch (suite also run under xdist: 175 passed). The change itself is sound — the token is assigned before run_server starts, the with conn, suppress(...) nesting order is right, failures_db is always a ServerStatusDB where .token is read, the token survives execnet serialization, and both new tests fail before the change and pass after.

Three things on the error paths, though; the first two chain into a session hang under xdist.

Comment created by Claude

Comment thread src/pytest_rerunfailures.py Outdated
Comment thread src/pytest_rerunfailures.py
Comment thread src/pytest_rerunfailures.py
@icemac
icemac merged commit 69ac0a7 into pytest-dev:master Sep 1, 2026
44 checks passed
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.

2 participants