Skip to content

ci: cache embedded postgres binaries in flake checks - #26986

Merged
ethanndickson merged 2 commits into
mainfrom
ci/flake-go-embedded-pg-cache
Jul 7, 2026
Merged

ethanndickson merged 2 commits into
mainfrom
ci/flake-go-embedded-pg-cache

Conversation

@ethanndickson

@ethanndickson ethanndickson commented Jul 6, 2026 •

Copy link
Copy Markdown
Member

flake-go keeps failing every TestServer subtest that boots coder server with built-in PostgreSQL (example run) with no version found matching 13.21.0, which is embedded-postgres's error for any non-200 while downloading the Postgres binary archive from Maven. The archive gets cached under the server's config root, which is a fresh temp dir in every test, so with test-count: 35 one flake run downloads it dozens of times and Maven rate-limits the runner. Using an external Postgres (like coder/terraform-provider-coderd#370 did) would defeat the point, since these subtests exist to exercise the built-in Postgres path.

Instead, startBuiltinPostgres now honors EMBEDDED_PG_CACHE_DIR as the archive cache path (test runs only, data/runtime dirs stay per-test), and flake-go.yaml wires in the existing embedded-pg-cache actions the same way the Windows/macOS lanes in ci.yaml already do. All iterations then share a single download, and usually zero once the actions cache is warm. The upload step only saves on main.

The flake-go job runs TestServer subtests that boot coder server with
built-in PostgreSQL up to 35 times. Each iteration used a fresh per-test
config root, so every run re-downloaded the embedded Postgres binary
archive from Maven. Maven rate-limits the shared runner egress IPs,
returning non-200 responses that fail all 10 startup retries with
"no version found matching 13.21.0".

Make startBuiltinPostgres honor EMBEDDED_PG_CACHE_DIR as the archive
cache path in test runs, and wire the existing embedded-pg cache
actions into flake-go.yaml so all iterations share one download,
usually restored from the actions cache.
@ethanndickson
ethanndickson marked this pull request as ready for review July 6, 2026 04:56
@ethanndickson
ethanndickson requested a review from ibetitsmike July 6, 2026 05:22
@ethanndickson
ethanndickson merged commit 8b60d1d into main Jul 7, 2026
28 of 29 checks passed
@ethanndickson
ethanndickson deleted the ci/flake-go-embedded-pg-cache branch July 7, 2026 01:44
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants