fix(runner): fail a parallel run aborted by a malformed annotation - #1337
Merged
Conversation
A malformed `@timeout` or `@retry` aborts the file it is in. Sequentially that exits the run, but under `--parallel` the abort happened inside the file's worker and never reached the parent: alongside one passing file the run printed the error and still reported "All tests passed" with exit 0, so the failure never reached CI. The abort is now recorded as one failed test, which is the question #1335 left open. It travels on both of the channels that cross the fork, because the console summary and the report writers read different ones: the named entry is spooled for the parent to replay, the counter goes in the payload the parent aggregates. Console, json, junit, html and markdown now agree, and the JUnit `testcase` carries the offending function and the real reason. Recorded from the aborting frame for two reasons. It is the only frame that still holds the function and the message, the caller having nothing but an exit status. And it is the worker under `--parallel`, whose own counter is discarded by design, so each channel contributes exactly once; recording in the parent instead would land on top of the published payload and re-create #1301. The wording is built once, so the report entry and the stderr line cannot drift. No console line is printed from there: the parent already replays the worker's stderr, and printing again would report one problem twice in two shapes. Sequential behaviour, the error text and the exit code are unchanged. Closes #1335
The console assertion covers only one of the two channels the count travels on. Recording the abort in the parent instead of the worker would leave the report at one failure and the console at two, which is the shape #1301 fixed, and nothing would have caught it. --log-junit has to follow --env: the env file blanks BASHUNIT_LOG_JUNIT as it is parsed, so a flag ahead of it is read and then overwritten.
5 tasks
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.
🤔 Background
Related #1335
A malformed
@timeoutor@retryaborts the file it is in. Sequentially that exits the run, but under--parallelthe abort stayed inside the file's worker: alongside one passing file the run printed the error and still reported "All tests passed" with exit 0, so the failure never reached CI.💡 Changes
testcasecarries the offending function and the real reason.--parallelit is the worker, whose own counter is discarded by design, so each channel contributes exactly once. Recording in the parent instead would land on top of the published payload and re-create --parallel reports count a file-level hook failure twice; the console says one #1301, which a new test guards.