Follow-up to https://github.com/coder/coder/pull/28919.
The tmpfs mount step only ran when `GOTMPDIR` was already exported, and
the only thing that exports it is `./.github/actions/setup-go-paths`,
which just `test-go-pg` uses. So on `test-go-pg-17`, `test-go-race-pg`
and `flake_go` the step printed `GOTMPDIR is not set, skipping` and
exited 0, and Go test binaries and `t.TempDir()` output stayed on the
root disk.
https://github.com/coder/coder/actions/runs/34359015069/job/102491022886
is one such run.
To fix, we'll just have the action default `GOTMPDIR` to
`${RUNNER_TEMP}/go-tmp` (the same path `setup-go-paths` uses) and export
it via `$GITHUB_ENV` before mounting. The skip path is gone, so a mount
failure now fails the step.
Worth noting that `test-go-pg`, where the mount was already active,
still stalled on
https://github.com/coder/coder/actions/runs/34481693660/job/102889890085,
with the `iostat` samples showing the disk at 100% utilisation
regardless. So I don't expect this to fix the stalls on its own, but it
at least makes all the Linux jobs behave the same whilst we chase the
underlying issue with Depot.
Closes CODAGT-878
This issue has bounced between Done and Triage since July, so I spent
some time working out where it was actually coming from before touching
anything.
The error is a server-sent HTTP/2 `RST_STREAM` from `proxy.golang.org`,
e.g. from https://github.com/coder/coder/actions/runs/34257346575:
```
github.com/armon/circbuf@v0.0.0-20190214190532-5111143e8da2: read "https://proxy.golang.org/github.com/armon/circbuf/@v/v0.0.0-20190214190532-5111143e8da2.zip": stream error: stream ID 173; INTERNAL_ERROR; received from peer
make: *** [Makefile:645: fmt/go] Error 1
```
It isn't Depot. The Go project sees the identical error on its own LUCI
builders (https://github.com/golang/go/issues/51323, 9 reports in August
and 4 so far in September, versus roughly one a month before that), and
someone on that thread reported it from GitHub-hosted runners too.
There's a CL in review to have `cmd/go` resume broken downloads
(https://go-review.googlesource.com/c/go/+/824044), but that won't reach
us on 1.26.x.
The reason it only started for us in July is on me: #27250 removed the
`go-cache` action, which also removed the retried `go mod download`
prefetch from every Go job, and the first report was the next day.
#27816 put the prefetch back for `lint` and `test-e2e` only, and since
then those two jobs have had zero recurrences across the 19 later
failing runs, whilst every recurrence has been in a job without it
(`fmt`, `gen`, `test-go-pg`, `test-go-race-pg`, `offlinedocs`).
So, the fix is just to add the same step everywhere else: `gen`, `fmt`,
`test-go-tailnet-integration`, `offlinedocs`, `sqlc-vet`, the shared
`test-go-pg` action (which covers the test matrix, `flake-go` and
`nightly-gauntlet`), and the bare `go mod download` in `pr-deploy`.
I did initially also set `GOPROXY=https://proxy.golang.org|direct`, so
`cmd/go` would fall through to a VCS fetch on any proxy error rather
than just 404/410, but I've dropped it. The Go team explicitly declined
to make that the default for security reasons
(https://github.com/golang/go/issues/37367), the fallback is silent so
we'd lose visibility of proxy incidents, and
`github.com/charmbracelet/glamour` contains Git LFS files, so a direct
fetch of it on our runners (which have `git-lfs` installed) would
produce a different zip and fail with a checksum mismatch
(https://github.com/golang/go/issues/41708). Not worth it for the rare
case where three consecutive proxy attempts all fail.
Seven `test-go-pg` failures on `main` since 2026-08-31 share one
signature: unrelated tests in different packages expire their contexts
within the same few seconds while the process keeps logging normally.
Only filesystem writes and database round trips stall. This points at
the runner's EBS-backed root disk, not CPU.
- Mount an 8 GB tmpfs on GOTMPDIR for Linux jobs using the test-go-pg
action. It holds test binaries and per-test temp dirs. Windows and macOS
already use RAM-backed storage; Linux was the only platform on disk.
- Stop `log_statement=all` on the CI test Postgres container. Nothing in
the test jobs reads it, and with 64 concurrent tests it is the largest
continuous disk writer. The gen job keeps the default.
- Sample `vmstat` and `iostat` during the test step and upload on
failure, so the next occurrence can confirm or refute the disk theory.
Depot documents the 8-core Linux runner as an EBS volume at 8000 IOPS
and 250 MB/s behind an 8 GB in-memory write buffer, which fits a stall
that hits every writer at once.
Refs coder/internal#1365
The Go test jobs in `ci.yaml` each had ~30 lines of inline shell that
wrapped `gotestsum` with a PATH shim to capture JSON, then ran
`gotestsummary` and `upload-artifact` to publish a failure report. Three
jobs carried three near-identical copies.
This change replaces the three inline blocks with a single composite
action at `.github/actions/go-test-failure-report/` that runs the same
`gotestsummary` invocation, writes the same markdown to
`GITHUB_STEP_SUMMARY`, and uploads the same NDJSON artifact. The PATH
shim is gone; gotestsum's native `GOTESTSUM_JSONFILE` env variable is
used instead, plumbed through the `test-go-pg` composite.
`test-go-pg` gains three optional inputs:
- `gotestsum-json-file` — explicit JSON file path (or `default` for
`${RUNNER_TEMP}/go-test.json`)
- `run-regex` — passed to `go test -run`
- `test-shuffle` — passed to `go test -shuffle`
All three have safe defaults so existing callers are unaffected.
No observable change in CI behavior: the three existing test-go-pg jobs
continue to emit the same JSON, render the same failure summary, and
upload the same artifact.
Stacked under #25667, which uses the new composite and inputs to power a
new flake-detector workflow.
related to: https://github.com/coder/internal/issues/1387
Sometimes our tests using DERP flake like the above, but we have no information at the DERP layer about why. This enables verbose DERP logging in CI.
Logs are kinda spammy, but most tests do not force DERP and so only use it for discovery (disco).
A test like TestWorkspaceAgentListeningPorts/OK_BlockDirect drops around 50 DERP packets e.g.
```
t.go:111: 2026-03-13 15:20:52.201 [debu] agent.net.tailnet.net.wgengine: magicsock: got derp-999 packet: "\x04\x00\x00\x00C}\xe0\xb9\x00\x00\x00\x00\x00\x00\x00\x00}\xae;l\xd9Hk8\xa8l\x1cK\xedO{狦)\x18NIw\xc4k\xd2-\x19\xbf\xfb\xdd\x17\xa9b\xac\xfd#\xf7\xcaC\xbe\vq(u=\xa7\x16\xe9\x9aLjS\x1fXL\x19y\xf4\x1dE%\xb3\xff\x9d:8\xa9\x95X\xfe\xf8\x95\x7f\x9dv$\f\xf4\xbe"
t.go:111: 2026-03-13 15:20:52.201 [debu] agent.net.tailnet.net.wgengine: magicsock: got derp-999 packet: "\x04\x00\x00\x00C}\xe0\xb9\x01\x00\x00\x00\x00\x00\x00\x00\x05x\xb6RD;\xb4\x80\xb6\x0f\xf6KŠc\xfb1\xbd\x06\xb70K3\x97`\x8d\xd2\x14\xed\xc5\xd6\xc6\xcaV\xbf\x878\xb2Ƥ\xf0\xd5\xf7\xc0\x1b\x9f\x04Y\x03\x17\xd4\x06\xee\xb2G\r){\x9f\xde\xe0(\xb5N\xfejR_\xf6q\xa4\xfaT\x9a\xd8\xcbk\xba\x16K"
t.go:111: 2026-03-13 15:20:52.201 [debu] agent.net.tailnet.net.wgengine: magicsock: got derp-999 packet: "\x04\x00\x00\x00C}\xe0\xb9\x02\x00\x00\x00\x00\x00\x00\x00\x1e\x93a\x15\xfev\x81'\xa9?\xe8nR\xce<\x91\x86\xcau@\xb9\xcfɩ\xef\xd1眓\x95\xf3*X^7\x99\x88\xb0|\x8cS\xe4@[\x16\xda\xca\xd4\xd9\x1dP\xd0\xfe\xd9r\x8c\xfcp~dP\xfaK\xe0\xf9y\xb2\x11\x15\xfe\xdcx鷽\xdeF\xf7\x92\xe8"
```
Follow-up to #22705 (pre-commit/pre-push hooks).
Unifies `test` and `test-race` into the same structure and lets CI call
`make test-race` instead of reproducing the gotestsum command.
**Parallelism**: Extracted from `GOTEST_FLAGS` into
`TEST_PARALLEL_PACKAGES`
/ `TEST_PARALLEL_TESTS` (default 8x8). `test-race` overrides to 4x4 via
target-specific Make variables. `TEST_NUM_PARALLEL_PACKAGES` and
`TEST_NUM_PARALLEL_TESTS` env vars continue to work for both targets.
**GOTEST_FLAGS**: Changed from simply-expanded (`:=`) to
recursively-expanded
(`=`) so target-specific overrides take effect at recipe time.
**CI**: `.github/actions/test-go-pg/action.yaml` now calls `make
test-race`
/ `make test` instead of hand-rolling the gotestsum command, eliminating
drift between local and CI configurations.
Refs #22705