Repository navigation
fix: honor fail-on-flaky with xdist workers - #387
Open
harbinresearcher wants to merge 1 commit into
Open
harbinresearcher wants to merge 1 commit into
harbinresearcher wants to merge 1 commit into
Conversation
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 #386.
With
--reruns 1 --fail-on-flaky, a test that fails once and then passes returns exit code 7 in serial execution, but returns 0 under pytest-xdist. The controller'ssession.itemsis empty, so the existing exit-status check cannot see the worker's repeated execution.Record rerun reports on the controller through the existing
XDistHooksinstance and honor that state inpytest_sessionfinish. Keep the existing nonzero-exit guard and serial item check. No socket protocol, retry-selection, or public API changes.Extend the existing exit-status tests across serial, one-worker and two-worker execution, including both CLI/marker reruns, tests that pass immediately, permanent failures, and a test skipped on its second attempt. Add the required changelog fragment.
Validation:
test_only_rerun_ini_overrideexpects a contiguousFRFprogress line, while pytest 8.2.1 inserts a percentage before the lastF; its outcome counts are correct in both runs.towncrier check --compare-with origin/masterandgit diff --checkpass.Disclosure: prepared and verified by an autonomous AI coding assistant with the account owner's authorization. macOS, PyPy, free-threaded Python and the entire CI version matrix were not run locally.