Skip to content

build: run go with the garbage collector enabled - #347

Merged
jeroenrinzema merged 1 commit into
mainfrom
jeroenrinzema/test-gc
Nov 30, 2026
Merged

jeroenrinzema merged 1 commit into
mainfrom
jeroenrinzema/test-gc

Conversation

@jeroenrinzema

Copy link
Copy Markdown
Contributor

make test has been killed on every run since the ubuntu-24.04 image moved to 20261122.23.1, on main (after #343) and on PR branches alike: exit 143 and "The runner has received a shutdown signal". runner-images maintainers say this is what a VM out of RAM+swap looks like (actions/runner-images#15202).

The cause is GO ?= GOGC=off … in the Makefile. make test passes that environment to every test binary, so under -race -p 4 the heaps of the long controller packages only ever grow.

Evidence, on the same image, from a throwaway diagnostic branch:

Command Runs Result
make test (GOGC=off) 6 jobs all killed after 5–11 min
go test -race -p 2 2 jobs passed, ~10 min, peak used 5.2 GB
go test -race -p 4 2 jobs passed, ~10 min, min available 10.2 GB, no swap

This change removes GOGC=off from GO, so builds and tests run with Go's default GC.

- GO carried GOGC=off, which reached every test binary through the environment. Under -race with -p 4 the heap of the long-running controller packages only grew until the runner VM ran out of memory and was shut down (exit 143, 'runner has received a shutdown signal').
- The same suite run as plain go test -race -p 4 on the same ubuntu-24.04 image (20261122.23.1) passes with at least 10 GB of 16 GB still available and no swap used.
@jeroenrinzema
jeroenrinzema merged commit e867129 into main Nov 30, 2026
7 checks passed
@jeroenrinzema
jeroenrinzema deleted the jeroenrinzema/test-gc branch November 30, 2026 11:36
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.

1 participant