fix: retry and cache e2e Coder release downloads to reduce test-e2e ssh flake#27470
Open
aqandrew wants to merge 1 commit into
Open
fix: retry and cache e2e Coder release downloads to reduce test-e2e ssh flake#27470aqandrew wants to merge 1 commit into
aqandrew wants to merge 1 commit into
Conversation
…sh flake The outdatedCLI/outdatedAgent e2e 'test ssh' cases download an old Coder release from GitHub via install.sh during setup. Transient GitHub errors (HTTP 403/503, surfacing as nonzero curl exit codes) make install.sh fail and take the ssh test down with it, even though SSH is never exercised. - Retry install.sh with exponential backoff in downloadCoderVersion so a single transient download failure no longer fails the test. - Persist /tmp/coder-e2e-cache across CI runs with actions/cache so most runs skip the GitHub download entirely. Saves are restricted to main to avoid cache poisoning, matching existing cache steps. Fixes coder/internal#218
aqandrew
marked this pull request as ready for review
July 23, 2026 21:53
aqandrew
requested review from
ethanndickson and
zenithwolf1000
and removed request for
aslilac
July 23, 2026 21:53
zenithwolf1000
approved these changes
Jul 23, 2026
zenithwolf1000
left a comment
Contributor
There was a problem hiding this comment.
Reasonable solution, lgtm! Just wanna call out that this is still not a bulletproof fix though
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.
closes DEVEX-651
Summary
Fixes coder/internal#218 (
flake: e2e-test / test ssh).Despite the title, the
ssh with client v2.8.0/ssh with agent v2.12.1cases (site/e2e/tests/outdatedCLI.spec.ts,outdatedAgent.spec.ts) are not failing because of a bug in SSH. They fail during setup, indownloadCoderVersion(), which runsinstall.shto fetch an old Coder release from GitHub. Transient GitHub errors (HTTP 403/503, surfacing as nonzerocurlexit codes such as 22 or 1) makeinstall.shfail and take the whole ssh test down with it.This is an external-download flake, confirmed by the recurring
install.sh failed with code {22,1}evidence in the issue thread and Ethan's note ("Networking issues again").Changes
site/e2e/helpers.ts):downloadCoderVersion()now retriesinstall.shup to 5 times with exponential backoff and jitter (~1s, 2s, 4s, 8s). A single transient download failure no longer fails the test.install.shalready reuses completed binaries and resumes partial downloads (curl -C -), so retries are cheap..github/workflows/ci.yaml): thetest-e2ejob now persists/tmp/coder-e2e-cachewithactions/cache, so most runs skip the GitHub download entirely. The key is derived from the spec files that pin the downloaded versions, so it invalidates when those versions change. Saves are restricted tomain(restoreruns everywhere), matching the existing cache-poisoning convention used for the Vale and golangci-lint caches.Before this change, neither retry, mirror, nor cross-run caching protected this path; the only caching was within a single run.
Testing
biome check e2e/helpers.tspasses.tsc --noEmitintroduces no new errors.test-e2eexercises the changed path.Investigation notes
downloadCoderVersion->install.sh->fetch()(curl -#fL ... https://github.com/coder/coder/releases/download/vX.Y.Z/...).curlexit 22 = server returned an HTTP error (403 seen in logs); exit 1 = other transient failure. GitHub also returned 503s across the workflow in some occurrences./tmp/coder-e2e-cachewas not persisted by anyactions/cachestep inci.yaml, so every fresh job re-downloaded from GitHub and was exposed to the flake.This PR was generated by Coder Agents on behalf of @aqandrew.