Skip to content

CTest retry can mask sequential-group failures in Full Build - #5689

Open
anchapin wants to merge 1 commit into
developfrom
fix-ctest-rerun-masking
Open

anchapin wants to merge 1 commit into
developfrom
fix-ctest-rerun-masking

Conversation

@anchapin

@anchapin anchapin commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

full-build.yml runs CTest in two groups: a few resource-locked ModelFixture tests one at a time, then everything else in parallel. If either failed, it ran one retry at the end with --rerun-failed and set exit_code from that retry.

--rerun-failed only reruns failures from the most recent ctest call, which is the parallel group. That retry also kept the -E filter that excludes the sequential tests. --rerun-failed matches failures by test number, and that filter renumbers the tests, so a failed sequential test was "rerun" as whichever test had its number in the filtered list (the second mechanism in #5660). So if a sequential test failed and any parallel test flaked in the same run, the retry ran only the flaky test, it passed, and the step reported exit_code=0.

This retries each group right after it fails and fails the step if either retry still fails. The change is the same in the Linux, macOS and Windows CTest steps.

Fixes #5660. Found while reviewing #5681. After that PR, Full Build is the only macOS/Windows test gate on PRs, so a masked failure there merges.

Testing

I ran the macOS step script, extracted from the workflow, against a three-test CTest project (one sequential-group test, one flaky parallel test, one passing test):

Sequential test Parallel test Before After
always fails flaky exit_code=0 exit_code=8
flaky flaky — 0
passes always fails — 8
passes passes — 0
flaky passes — 0
passes flaky — 0

With the sequential test moved to the end of the test list (so the renumbering applies), the old script also hid a sequential failure with no other failures (always fails / passes: before 0, after 8). The new script gave the expected result in every case in both orders.

I didn't run the PowerShell (Windows) version locally; its logic matches the bash version. actionlint reports no new issues (37 → 35).

🤖 Generated with Claude Code

…en't masked

ctest --rerun-failed only reruns failures from the most recent ctest call.
The single retry at the end only saw the parallel group's failures (and
excluded the sequential tests anyway), then reset exit_code to 0 when they
passed. A sequential-group failure plus any flaky parallel test went green.
Retry each group immediately after it fails, and fail the step if either
retry still fails. Applies to the Linux, macOS and Windows CTest steps.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] full-build.yml: a failure in the resource-locked test group can be cleared by the rerun, and the job passes

1 participant