Conversation
Keep reported internal errors separate from worker termination. Wait for terminal events and drain workers before propagating a confirmed internal-error exit status.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keep workers active after internal-error notifications until they actually finish or disconnect, preventing duplicate-removal and no-active-worker errors. Report-only notifications remain nonfatal; confirmed fatal worker exits are propagated after worker shutdown.
Fixes #986.
Validation limits: Local testing used Windows/Python 3.14 and excluded five cases requiring more than two workers. Two
pytestmainCI jobs fail grouping checks that also fail on the base commit in a controlled local comparison.Implementation and validation
config.notify_exception()reports an exception but does not itself terminate a worker. Active-worker removal now remains withworkerfinishedanderrordown; a confirmedINTERNAL_ERRORcompletion triggers shutdown and exit code 3 after the remaining worker events are processed.Real pytester/execnet subprocess cases cover the original collection notifications, report-only finish notifications, fatal collection/runtest hooks, and notification followed by a crash/restart. Native pytest comparisons establish exit 0 for report-only finish notifications and exit 3 for the collection reproducer's subsequent pytest capture failure; the fix preserves these outcomes without xdist bookkeeping errors.
The five excluded cases use three or four workers; no tests, restart limits, or checks were modified to avoid running them.
The CI comparison pinned pytest to 99ab2accc, the exact revision from both failed jobs. All five affected grouping tests fail on both the base and this branch, without
INTERNALERROR: that pytest revision reads_idfornodeid, while unchanged xdist worker code writes_nodeid. The comparison used Windows/Python 3.14, not CI's Python 3.11 environments. This separate compatibility problem was not changed, and the CI gate remains unresolved.Repository checklist
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
changelogfolder following these guidelines:Name it
$issue_id.$typefor example588.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,docortrivialMake sure to use full sentences with correct case and punctuation, for example: