Allow flaky conditions to inspect failure exceptions - #365
Merged
icemac merged 2 commits intoSep 9, 2026
Conversation
Contributor
|
The test failures against pytest-main are also on |
Contributor
|
|
icemac
reviewed
Sep 8, 2026
icemac
left a comment
Contributor
There was a problem hiding this comment.
Thanks for working on #230 — the xdist-safe approach of keeping ExceptionInfo on the worker-side item is the right idea. A few things need fixing before this can go in; two of them abort the whole run with INTERNALERROR, and one makes the feature a no-op for failed subtests. Details inline.
— Comment created by Claude
Keep ExceptionInfo on the worker-side item so callable and string conditions can inspect failure attributes without breaking xdist report serialization. Cover matching and nonmatching call errors, setup and teardown failures, single evaluation, and the xdist regression.
ryux1
force-pushed
the
fix/230-exception-aware-condition
branch
from
September 8, 2026 14:02
9dfe284 to
04cb3ef
Compare
icemac
approved these changes
Sep 9, 2026
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.
Closes #230
This lets flaky conditions make one rerun decision for an entire test attempt from the exceptions that caused its failed phases:
errorname;ExceptionInfostays on the worker-local test item, so xdist never serializes it, and the cached exception state is cleared after every attempt. Condition evaluation errors become non-fatal warnings even when warning filters promote warnings to errors.Validation:
pre-commit run --all-filespassed