Skip to content

fix(runner): fail a parallel run aborted by a malformed annotation - #1337

Merged
Chemaclass merged 2 commits into
mainfrom
fix/1335-annotation-abort-fails-a-parallel-run
Aug 21, 2026
Merged

fix(runner): fail a parallel run aborted by a malformed annotation#1337
Chemaclass merged 2 commits into
mainfrom
fix/1335-annotation-abort-fails-a-parallel-run

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Related #1335

A malformed @timeout or @retry aborts the file it is in. Sequentially that exits the run, but under --parallel the 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

  • The abort counts as one failed test, which is the question the issue left open. It travels on both channels that cross the fork, because the console summary and the report writers read different ones. 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 still holding the function and the message, the caller having nothing but an exit status. And under --parallel it 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.
  • The wording is built in one place, so the report entry and the stderr line cannot drift apart. Nothing extra is printed to the console: 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. Verified on bash 3.2 and bash 5.3.

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
@Chemaclass Chemaclass added the bug Something isn't working label Aug 21, 2026
@Chemaclass Chemaclass self-assigned this Aug 21, 2026
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.
@Chemaclass
Chemaclass merged commit 6a80fa4 into main Aug 21, 2026
37 checks passed
@Chemaclass
Chemaclass deleted the fix/1335-annotation-abort-fails-a-parallel-run branch August 21, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant