fix(#6105): retry GetFileContent on 404 in post-install validation - #6106
Conversation
ValidatePerRepoPostInstall reads back files immediately after fullsend github setup commits them. The GitHub API can return transient 404s due to read-after-write eventual consistency, causing TestBehaviourSuite to fail intermittently and ejecting PRs from the merge queue. Add a getFileWithRetry helper that retries GetFileContent up to 5 times with 2-second backoff when the error is a 404 (forge.IsNotFound). Non-404 errors fail immediately. The retry budget (5 attempts, 2s apart = ~8s max) matches the existing waitForFileAccessible pattern in url_dispatch.go. The retry delay is a package-level var overridden to zero in tests to keep the suite fast. Added speedUpValidateRetries to existing ensure_test.go tests that exercise the validation path with installed=false to prevent the new retries from slowing them down. Note: pre-commit could not run (sandbox network policy blocks git fetch for hook environment setup). go vet and tests passed. Closes #6105
|
🤖 Finished Review · ✅ Success · Started 3:23 PM UTC · Completed 3:34 PM UTC Commit: |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Looks good to me Labels: PR fixes e2e test flakiness in the install driver's post-install validation |
|
🤖 Finished Retro · ✅ Success · Started 4:03 PM UTC · Completed 4:19 PM UTC Commit: |
Retro: PR #6106 — retry GetFileContent on 404 in post-install validationWorkflow quality: Excellent. This was a clean end-to-end autonomous workflow with zero rework, first-attempt code success, and full agent–human alignment on review. Timeline
What went well
Merge queue delay (not an agent workflow issue)The 48-hour gap between human approval and merge was caused by two merge queue ejections from GCP WIF quota exhaustion (HTTP 429) in E2E test setup, plus a GitHub API timeout. The PR's own code was not the cause. Re-queuing happened manually ~once per day. Evidence for existing open issues
Autonomy readinessThis PR demonstrates zero agent–human review delta on a well-scoped test-infrastructure bug fix with comprehensive tests and all CI green. The class of change — single-issue driver fix following established patterns, with 89% patch coverage — is a candidate for reduced human review requirements. See #3026 for the broader tracking effort. No proposals filedAll improvement areas identified are already tracked by existing open issues. No new proposals are warranted. |
Summary
ValidatePerRepoPostInstallinpkg/behaviourtest/drivers/install/validate.goto tolerate GitHub API read-after-write eventual consistencygetFileWithRetryhelper retriesGetFileContentup to 5 times with 2-second backoff when the error is a 404 (forge.IsNotFound); non-404 errors fail immediatelyValidatePerRepoPostInstallwith transient 404sContext
TestBehaviourSuiteintermittently fails during post-install validation with a 404 reading back.github/workflows/fullsend.yamlimmediately afterfullsend github setupcommits it. This caused merge queue ejections (e.g., PR #5736). The retry budget (5 attempts, 2s apart = ~8s max) matches the existingwaitForFileAccessiblepattern inurl_dispatch.go.Test plan
getFileWithRetryunit tests pass (transient 404, exhausted retries, non-404 immediate failure, context cancellation)ValidatePerRepoPostInstallintegration tests pass (retry success, clear error on exhaustion)pkg/behaviourtest/drivers/install/...pass (42 tests, 0.078s)go vetpassesCloses #6105
Post-script verification
agent/6105-validate-retry-on-404)d62fc7141712252d51853fa6a9be5af6b929251b..HEAD)