fix(e2e): retry lock verification read to handle auto_init race - #1614
Conversation
Site previewPreview: https://1f3a1d03-site.fullsend-ai.workers.dev Commit: |
ReviewFindingsNo findings. The retry loop correctly handles the Previous runReviewFindingsNo findings. The retry loop correctly handles the Previous runReviewFindingsNo findings. The retry loop correctly handles the Previous runReviewFindingsNo findings. The retry loop correctly handles the Previous run (2)ReviewFindingsNo findings. The retry loop correctly handles the |
GitHub's auto_init creates a default README.md asynchronously when a
repo is created. Our CreateOrUpdateFile overwrites it, but GitHub's
eventual consistency can briefly serve the stale auto_init content
("# e2e-lock") on subsequent reads.
This caused tryCreateLock to think it lost the lock race when it had
actually won — the verification read returned auto_init content
instead of our run ID.
Retry the verification read up to 5 times with linear backoff,
logging each mismatch so the auto_init race is visible in CI logs.
Signed-off-by: Ryan Bean <rbean@redhat.com>
Assisted-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ralph Bean <rbean@redhat.com>
3fe45e4 to
29b66f6
Compare
Summary
auto_initcreates a default README.md asynchronously when a repo is createdCreateOrUpdateFileoverwrites it, but the verification read can briefly return the stale auto-init content (# e2e-lock) instead of our run IDtryCreateLockto think it lost the lock race when it had actually wonDepends on #1612 — based on
fix/e2e-lock-debug.Test plan
go test -tags e2e ./e2e/admin/ -run TestAcquirepassesmake go-testpassesmake lintpasses🤖 Generated with Claude Code