Repository navigation
flake: test-go-pg (macos) job timeout/cancelled #1365
Description
Current understanding (updated 2026-10-07)
The macOS failures on this ticket are memory exhaustion inside the cli test binary, not a runner pause. On 2026-10-07 the process allocated about 6 GiB in 8 seconds, grew to 47 GB resident on a 17 GiB runner, pushed swap to 34 GB, and exited silently before the Go test timeout could dump goroutines. The per-second runner sampler never gapped, so the host did not stall. The "runner suspension / severe host stall" classification in the 2026-08-06, 2026-09-27, and 2026-10-07 comments, and the earlier host-side theory, are superseded. See the 2026-10-07 analysis comment.
The allocation site is not yet known. coder/coder#30487 adds a memory guard that fails the process at 6 GiB with a heap profile and a goroutine dump. On the next macOS occurrence: download the heap-profiles-test-go-pg-macOS artifact and run go tool pprof -top -sample_index=alloc_space on it. The panic line in the job log names the file.
Scope: this ticket tracks the macOS cli.test memory burst. The 2026-09-02 and 2026-09-07 Linux occurrences show short scheduling gaps with flat memory and are not shown to share this cause. The 2026-10-06 macOS hang in TestAgent_SSHConnectionEnvVars/SSH_CLIENT is also separate. New occurrences of either should get their own ticket.
The original report below (February 2026, GOCACHEPROG shutdown hang after all tests passed) was a different failure and is kept for history.
CI Run Link: https://github.com/coder/coder/actions/runs/22303873776
Failed Job: test-go-pg (macos-latest) https://github.com/coder/coder/actions/runs/22303873776/job/64518157527
Aggregator failure: required job failed because test-go-pg was cancelled
Commit Info:
- SHA: b776a14b46fc14a972d15d59473daa5f150d452c
- Author: Thomas Kosiewski
- Message: fix(coderd): harden OAuth2 provider security (#22194)
Failure evidence:
- required job output:
- test-go-pg: cancelled
One of the required checks has failed or has been cancelled
- macOS job log (test step):
2026-02-23T11:24:37Z ok github.com/coder/coder/v2/cli 100.025s
2026-02-23T11:44:25Z ##[error]The operation was canceled.
Timeline / timeout context:
- test-go-pg job has
timeout-minutes: 25in .github/workflows/ci.yaml. - Job started at ~11:19:13Z and was cancelled at 11:44:25Z (≈25 minutes).
- No further test output appeared between 11:24:37Z and cancellation, suggesting the
make teststep hung or stalled and hit the job timeout.
Root cause classification: Infrastructure / test suite hang
- The macOS test-go-pg job exceeded the 25-minute job timeout during
make test(gotestsum over ./cli/... ./enterprise/cli/... ./agent/...). - No
WARNING: DATA RACE, panic, or OOM indicators found in the job log; cancellation is consistent with the workflow timeout rather than a specific test failure.
Assignment analysis (component / infra ownership):
- No specific test function identified (gotestsum standard-quiet output stops before hang), so test-level blame isn’t possible.
- Using infra ownership fallback:
git log --oneline -10 .github/actions/test-go-pg/action.yaml- 7d558e7 fix: make
make testrunnable again (Danny Kopping) - 84b7a03 chore: abstract pg test logic and double runner sizes (Danny Kopping)
- 7d558e7 fix: make
- Assigning to @dannykopping as the most recent meaningful maintainer of the test-go-pg action and parallelism logic.
Related issues search:
- Searched coder/internal for: "test-go-pg macos cancelled", "operation was canceled", "test-go-pg timeout", "job timeout" — no matching open issues found.
Reproduction:
- Re-run the CI workflow on main and watch test-go-pg (macos-latest).
- Locally on macOS:
TEST_PACKAGES="./cli/... ./enterprise/cli/... ./agent/..." make test(observe for hang or unusually long runtime).
Activity
zedkipp commentedon Feb 23, 2026
I took a first pass at this failure. Seems like all tests passed, but something got stuck after all tests ran.
Some interesting logs from 16_test-go-pg (macos-latest).txt
Then at cleanup:
During cleanup the
depotprocess (pid 3969) and its parentgoprocess (pid 3968) were both still alive 20 minutes after all tests passed. It seems like go test couldn't exit becausedepot gocache(spawned viaGOCACHEPROG) didn't shut down.I did some digging on how
GOCACHEPROGworks.goessentially tells the subprocess to exit over stdin/stdout with a protocol specific toGOCACHEPROG.Happy path expectation:
Given that the
depotandgoprocess were both still alive, the hang could be:depot gocachenever received or processed the close commanddepot gocachereceived close but hung during its cleanup/flushgonever sent the close commandI didn't find anything in the Go issue tracker for any known issues with the cleanup/shutdown pathway. I am going to send a message to Depot and see if this is a known issue.
dannykopping commentedon Feb 24, 2026
@zedkipp thanks for taking a look! I'll close this from our side in the interim, but please post any updates you get.
flake-investigator commentedon May 15, 2026
Recurrence on main:
Evidence from job log:
Notes:
timeout-minutes: 25in.github/workflows/ci.yaml(test-go-pg).make test(packages:./cli/... ./enterprise/cli/... ./agent/...).WARNING: DATA RACE, panic traces, or OOM indicators found in the retrieved logs.Root cause remains: macOS test-go-pg job timed out/hung during tests; required check failed due to cancellation.
flake-investigator commentedon Jun 25, 2026
New occurrence (same failure mode):
CI Run: https://github.com/coder/coder/actions/runs/28139812015
Failed Job: https://github.com/coder/coder/actions/runs/28139812015/job/83336219257 (test-go-pg (macos-latest))
Aggregator failure: required job failed because test-go-pg was cancelled.
Commit Info:
Failure date: 2026-06-25
Key evidence:
Timeout context:
timeout-minutes: 25for test-go-pg in .github/workflows/ci.yaml.No
WARNING: DATA RACE, panic, or OOM indicators found in the retrieved logs.fix(testutil/expecter): remove nested pipe from output logging path (#…
fix: raise test-go-pg timeout budget, lower macOS parallelism (#27997)
BobbyHo commentedon Aug 25, 2026
Verification: no recurrence since the last fix (checked 2026-08-25)
Note on which fix is "the last one": the PR attached to this ticket (coder/coder#27204, merged 2026-07-15) was only a partial fix and said so. A second change landed after the 2026-08-06 recurrence reported above:
testutil/expecter: removed the nestedio.Pipein the debug-logging path that could deadlock a command's writesgo test -timeout20m to 25m, jobtimeout-minutes25 to 30, macOStest-parallelism-tests16 to 8The 2026-08-06 occurrence therefore predates the current mitigation and is not evidence against it.
Result
No recurrence of the timeout/hang signature in the 15 days since #27997.
test-go-pg (macos-latest)jobs onmainsucceeded since 2026-08-10T19:29Z. Method: listed all 637ci.yamlruns onmainsince 2026-07-15, then pulled job-level results for every run in the post-fix window (288 runs; the rest of the gap iscancelledruns that were superseded by a later push before any job started).cancelledmacOS jobs. The original 25-minute job-cancellation signature is absent.The only three macOS
test-go-pgfailures in the whole window since #27204 all predate #27997:test-jsandStorybook(unknown))Upload Test Cacheafter tests passed. Unrelated to this ticketRelated but not this flake
nightly-gauntlettest-go-pg (macos-latest)failed on 2026-08-11, 2026-08-19, and 2026-08-20, after the fix. These are not this failure mode: each ended withDONE ~29,700 tests, 1 to 3 failures, that is, a small number of genuine per-test flakes. This ticket's signature is a single process death that marks hundreds of in-flight subtests(unknown), which is what 2026-08-06 showed and these do not.No new flake-bot report has landed on this issue since 2026-08-06.
Scope and caveat
The scan covered
mainci.yamlruns andnightly-gauntlet. It did not cover PR-branch runs, where failures are dominated by genuine test failures and the API result cap makes an exhaustive sweep impractical. Flake alerting for this ticket fires onmain, so this matches how the issue has been tracked.#27997 is a mitigation, not a confirmed root cause: the underlying macOS runner scheduling stall is still unexplained, and the Depot
GOCACHEPROGshutdown hang from the original report lives outside this repo. The 25m/30m split is deliberate so that a future hang produces a goroutine dump fromgo testinstead of a silent runner kill. Recommend closing on the evidence above and reopening if the flake bot files another occurrence, at which point the goroutine dump should be available.ci: move Linux Go temp dir to tmpfs and stop Postgres statement loggi…
BobbyHo commentedon Oct 7, 2026
Correction, 2026-10-07: the macOS failures are memory exhaustion inside the
clitest binary, not a runner pause. The telemetry from coder/coder#30050 shows the process allocating about 6 GiB in 8 seconds and going deep into swap while the runner's per-second sampler never gapped. The "runner suspension / severe host stall" classification and the earlier host-side theory are superseded.The allocation site is still unknown. coder/coder#30487 adds a memory guard that fails the process at 6 GiB with a heap profile and a goroutine dump, and uploads the profile. Full details are in the 2026-10-07 analysis comment on the Linear issue.
ci: fail the test process with a heap profile when memory passes a pe…