Skip to content

fix: retry and cache e2e Coder release downloads to reduce test-e2e ssh flake#27470

Open
aqandrew wants to merge 1 commit into
mainfrom
flake/218-e2e-download-retry-cache
Open

fix: retry and cache e2e Coder release downloads to reduce test-e2e ssh flake#27470
aqandrew wants to merge 1 commit into
mainfrom
flake/218-e2e-download-retry-cache

Conversation

@aqandrew

@aqandrew aqandrew commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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.1 cases (site/e2e/tests/outdatedCLI.spec.ts, outdatedAgent.spec.ts) are not failing because of a bug in SSH. They fail during setup, in downloadCoderVersion(), which runs install.sh to fetch an old Coder release from GitHub. Transient GitHub errors (HTTP 403/503, surfacing as nonzero curl exit codes such as 22 or 1) make install.sh fail 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

  1. Retry-with-backoff (site/e2e/helpers.ts): downloadCoderVersion() now retries install.sh up to 5 times with exponential backoff and jitter (~1s, 2s, 4s, 8s). A single transient download failure no longer fails the test. install.sh already reuses completed binaries and resumes partial downloads (curl -C -), so retries are cheap.
  2. Cross-run cache (.github/workflows/ci.yaml): the test-e2e job now persists /tmp/coder-e2e-cache with actions/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 to main (restore runs 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.ts passes.
  • tsc --noEmit introduces no new errors.
  • CI test-e2e exercises the changed path.
Investigation notes
  • The failure always originates in downloadCoderVersion -> install.sh -> fetch() (curl -#fL ... https://github.com/coder/coder/releases/download/vX.Y.Z/...).
  • curl exit 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-cache was not persisted by any actions/cache step in ci.yaml, so every fresh job re-downloaded from GitHub and was exposed to the flake.
  • Retry addresses transient failures; the cache removes the dependency on GitHub for most runs. Combined, they target the root cause at two layers.

This PR was generated by Coder Agents on behalf of @aqandrew.

…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
aqandrew requested a review from aslilac July 23, 2026 21:53
@aqandrew
aqandrew marked this pull request as ready for review July 23, 2026 21:53
@aqandrew
aqandrew requested review from ethanndickson and zenithwolf1000 and removed request for aslilac July 23, 2026 21:53
@linear-code

linear-code Bot commented Jul 23, 2026

Copy link
Copy Markdown

DEVEX-651

@zenithwolf1000 zenithwolf1000 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reasonable solution, lgtm! Just wanna call out that this is still not a bulletproof fix though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flake: e2e-test/test ssh

2 participants