fix: honor all stop-on-* flags in parallel mode#1684
Open
stsepelin wants to merge 1 commit into
Open
Conversation
Previously --stop-on-failure was the only flag honored in parallel mode, and it only cleared pending tests when the exit code was non-zero. The rest (--stop-on-defect, --stop-on-error, --stop-on-risky, --stop-on-incomplete, --stop-on-warning, --stop-on-notice, --stop-on-deprecation, --stop-on-skipped) were silently ignored. WrapperRunner now precomputes the set of progress-file characters that should trigger a stop (F, E, R, I, W, N, D, S) based on the configured flags, and scans each worker's progress file for them after every cycle. Once any matching outcome is seen, the pending queue is cleared. Up to N-1 in-flight tests (where N is --processes) can still complete after the first stop-worthy outcome — stopping them mid-run would risk corrupting shared state. Closes pestphp#1463.
bed7a3d to
853e4af
Compare
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.
What:
Description:
In parallel mode only
--stop-on-failurewas honored, and only when a worker exited with a non-zero code. The seven other stop-on-* flags (--stop-on-defect,--stop-on-error,--stop-on-risky,--stop-on-incomplete,--stop-on-warning,--stop-on-notice,--stop-on-deprecation,--stop-on-skipped) were silently ignored - the test suite carried on to completion regardless.WrapperRunnernow precomputes the set of progress-file characters that should trigger a stop (F,E,R,I,W,N,D,S) from the configured flags, and scans each worker's progress file for them after every cycle. Once any matching outcome is seen, the pending queue is cleared so no further tests are dispatched.Known limitation: up to
N - 1in-flight tests (whereNis--processes) can still complete after the first stop-worthy outcome. Interrupting them mid-run would risk corrupting shared state (databases, fixtures, temp files), so they are allowed to finish.Integration coverage lives in
tests/Visual/Parallel.phpwith a shared fixture attests/.tests/ParallelStopOn/— oneHas*Test.phptrigger per outcome type plus aPassing/subdir of ten passing fixtures. A--filterregex selects exactly one trigger alongside the passing set per scenario, keeping the fixture DRY.Related:
Closes #1463.