fix: retry whole scenarios on transient act/docker execution flake#124
Merged
Conversation
Tag a non-zero act exit as an execution-layer hiccup (ExecError) distinct from a real job-level failure conclusion, and return a sentinel-wrapped error from the orchestrate/promote/hotfix failure paths so callers can tell a retryable infrastructure flake from a deterministic outcome. Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Wrap each multi-step scenario in a bounded retry that re-runs the entire scenario from a fresh gitea repo and fresh act containers when, and only when, a step fails with a transient act/docker execution error. Real assertion mismatches, expect_failure mismatches, and genuine job-level failures fail on the first attempt with no retry, so a flake never masks a real regression. Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
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.
Problem
Even serialized at
-parallel 1with the gitea-API retry from #121, the act-heavymulti-step e2e scenarios still occasionally fail with a transient
workflow execution failedon an act run. This is an act/docker exec hiccup, not agitea throttle and not a real assertion failure. At roughly one transient per full
suite run across about 30 scenarios, a full run is only ~40-60% likely to be fully
green, which makes three consecutive green Orchestrate runs unlikely.
Retrying a partial, state-mutating act run in place is unsafe, so #121 deliberately
left act-run retry out.
Fix
Each multi-step scenario already runs against a fresh per-scenario gitea repo and
fresh act containers, so re-running an entire scenario from scratch is a clean slate
with no carried-over mutation. That is the safe layer to retry at.
ExecErrorflag on the workflow result; the orchestrate, promote, and hotfix failure paths
return an error wrapping a sentinel (
errTransientWorkflow) only in that case. Areal job-level
failureconclusion, a missing-workflow failure, and everyassertion mismatch stay plain errors.
scenario from a fresh harness, retrying only on the sentinel. Real assertion
failures,
expect_failuremismatches, and genuine job-level failures fail on thefirst attempt with no retry, so a flake can never mask a regression. Every retry is
logged so flakes stay visible.
Verification
go build ./...,go vet ./..., andgolangci-lint run ./...clean (root and thee2e module).
(passes first attempt, recovers after a transient, fails immediately on an
assertion error, does not retry a real job failure, exhausts the bound on a
persistent transient). Full e2e short suite green; new tests pass under
-race.Hotfix_Stacked,Four_Environment_Cascade_Promotion, and the promote rollback scenario) live underDocker. One run reproduced the exact transient at the promote baseline step and the
retry recovered it on the second attempt; a second clean run passed all three with
no retry needed.