fix(e2e): close gitea lost-commit race that flakes the Orchestrate e2e job#110
Merged
Conversation
The e2e harness pushed generated workflows via raw git push from the act container, then immediately wrote the next commit through gitea's Contents API. Under parallel-suite load gitea's API layer could hold a stale branch head from before the push, parent the API commit on it, and move the branch ref there - silently discarding the workflows commit. The later fetch+reset then produced a tree with no .github/workflows, surfacing as a misattributed generate-workflow failure. Verify the push converged before returning: read the pushed SHA in the container and poll gitea's branch head until it matches (bounded). Add a bounded fetch+reset retry at the sync site with its own distinct error message, and treat docker-exec transport errors in the workflow probe as retryable rather than as a missing file. Cap build-cli e2e parallelism at 2 to match e2e.yaml and shrink the race window. 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
The Orchestrate
Build (cli) / E2E Testsjob on main intermittently fails withgenerate-workflow exited 0 but did not produce .github/workflows/orchestrate.yaml. Root cause is a lost-commit race in the e2e harness, not a generate problem:GenerateWorkflowspushes the workflows commit via rawgit pushfrom the act container, then the next runner step commits through gitea's Contents API. Under parallel-suite load gitea's API layer can hold a stale branch head, parent the API commit on the pre-push head, and move the ref to it, silently discarding the pushed workflows commit. The latergit fetch && git reset --hard origin/mainthen yields a tree with no workflows directory.Fix
git push, poll gitea's head SHA until it matches the pushed SHA before returning, closing the staleness window deterministically (includes a fix to demux the docker exec stream before parsing the pushed SHA).-parallel 4to-parallel 2in build-cli.yaml to match e2e.yaml and its documented memory rationale, shrinking the race window.Verification
lost_commit_test.gounit test passes.TestMultiStepScenarios/Two_Environment_Happy_Pathscenario is run repeatedly post-fix to confirm it is consistently green. The definitive proof is consecutive green Orchestrate runs on main after merge.