Skip to content

Fix hang with --dist=loadgroup if a crashed worker is replaced - #1324

Merged
RonnyPfannschmidt merged 2 commits into
pytest-dev:masterfrom
radoering:fix-loadgroup-hang
Aug 27, 2026
Merged

RonnyPfannschmidt merged 2 commits into
pytest-dev:masterfrom
radoering:fix-loadgroup-hang

Conversation

@radoering

@radoering radoering commented Apr 18, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #1323

In addition to the fix in remove_node(), I added a sanity check in _assign_work_unit(). (Without the fix and the sanity check the unit test hangs. Without the fix but with the sanity check, it fails due to the RuntimeError.)

@radoering
radoering force-pushed the fix-loadgroup-hang branch from 6c94249 to 25282ab Compare April 27, 2026 14:19

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks

@radoering

Copy link
Copy Markdown
Contributor Author

@RonnyPfannschmidt Since you approved the PR some time ago, I am wondering what is still preventing the merge?

@RonnyPfannschmidt
RonnyPfannschmidt merged commit 63f908d into pytest-dev:master Aug 27, 2026
23 checks passed
@radoering

Copy link
Copy Markdown
Contributor Author

@RonnyPfannschmidt Thanks for merging. 🙏 Maybe, if time permits you can take a look if #1328 is also an acceptable fix? (Different root cause, but similar consequences.)

dwaynebailey added a commit to dwaynebailey/virtaal that referenced this pull request Oct 11, 2026
pytest-xdist 3.8.0 puts every group a crashed worker had back on the
queue, finished ones included. The replacement worker is sent a group
with no tests left, never reports, and is never given more work, so
test-macos hangs until its watchdog. Drop the finished groups first,
as xdist does after 3.8.0 (pytest-dev/pytest-xdist#1324).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tooclassyforthisworld pushed a commit to tooclassyforthisworld/virtaal that referenced this pull request Oct 12, 2026
pytest-xdist 3.8.0 puts every group a crashed worker had back on the
queue, finished ones included. The replacement worker is sent a group
with no tests left, never reports, and is never given more work, so
test-macos hangs until its watchdog. Drop the finished groups first,
as xdist does after 3.8.0 (pytest-dev/pytest-xdist#1324).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

pytest --dist=loadgroup hangs if a crashed worker is restarted

2 participants