Skip to content

Respect explicit worker execution models - #1392

Merged
RonnyPfannschmidt merged 3 commits into
pytest-dev:masterfrom
SAY-5:fix-explicit-worker-execmodel-20261001
Oct 6, 2026
Merged

RonnyPfannschmidt merged 3 commits into
pytest-dev:masterfrom
SAY-5:fix-explicit-worker-execmodel-20261001

Conversation

@SAY-5

@SAY-5 SAY-5 commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

--tx=popen//execmodel=thread currently fails while constructing its worker specification because NodeManager prepends a second execmodel value. Both the constructor and setup_node() now supply main_thread_only only when the specification has no explicit model. The controller still uses main_thread_only.

This fixes the duplicate-key bug reported in #1069 (comment). It does not implement automatic gevent monkey-patching from the original issue.

Tests cover string and XSpec inputs, direct gateway setup with a real local worker, and an end-to-end thread-worker run. Before the change, eight cases fail with the duplicate-key error and four controls pass; afterward all twelve pass.

Validation on macOS ARM64, CPython 3.13.9, pytest 8.4.2 and execnet 2.1.2:

  • Complete test_workermanage.py and test_remote.py: 49 passed, one SSH-dependent skip, three existing expected failures.
  • Complete test_plugin.py: 37 passed, one optional-psutil skip.
  • Pinned Ruff 0.16.5 lint and formatting checks passed for all 32 Python files.

Gevent and eventlet cases check specification preservation without executing those optional backends. The full suite, other interpreter/platform combinations and remaining pre-commit hooks were not run locally.

AI assistance: Codex assisted with the implementation, regression tests, review and this description.

Thanks for submitting a PR, your contribution is really appreciated!

Here's a quick checklist that should be present in PRs:

  • Make sure to include reasonable tests for your change if necessary

  • We use towncrier for changelog management, so please add a news file into the changelog folder following these guidelines:

    • Name it $issue_id.$type for example 588.bugfix;

    • If you don't have an issue_id change it to the PR id after creating it

    • Ensure type is one of removal, feature, bugfix, vendor, doc or trivial

    • Make sure to use full sentences with correct case and punctuation, for example:

      Fix issue with non-ascii contents in doctest text files.
      

@RonnyPfannschmidt

Copy link
Copy Markdown
Member

the failures are expected and will be fixed elsewhere, thanks

@RonnyPfannschmidt
RonnyPfannschmidt merged commit 56725a1 into pytest-dev:master Oct 6, 2026
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants