diff --git a/.github/actions/test-go-pg/action.yaml b/.github/actions/test-go-pg/action.yaml index 5f19da6910..f14939da97 100644 --- a/.github/actions/test-go-pg/action.yaml +++ b/.github/actions/test-go-pg/action.yaml @@ -71,6 +71,7 @@ runs: if [[ ${RACE_DETECTION} == true ]]; then gotestsum --junitfile="gotests.xml" --packages="${TEST_PACKAGES}" -- \ + -tags=testsmallbatch \ -race \ -parallel "${TEST_NUM_PARALLEL_TESTS}" \ -p "${TEST_NUM_PARALLEL_PACKAGES}" diff --git a/Makefile b/Makefile index 39541c10b8..2ca4661e22 100644 --- a/Makefile +++ b/Makefile @@ -1018,7 +1018,8 @@ endif # default to 8x8 parallelism to avoid overwhelming our workspaces. Hopefully we can remove these defaults # when we get our test suite's resource utilization under control. -GOTEST_FLAGS := -v -p $(or $(TEST_NUM_PARALLEL_PACKAGES),"8") -parallel=$(or $(TEST_NUM_PARALLEL_TESTS),"8") +# Use testsmallbatch tag to reduce wireguard memory allocation in tests (from ~18GB to negligible). +GOTEST_FLAGS := -tags=testsmallbatch -v -p $(or $(TEST_NUM_PARALLEL_PACKAGES),"8") -parallel=$(or $(TEST_NUM_PARALLEL_TESTS),"8") # The most common use is to set TEST_COUNT=1 to avoid Go's test cache. ifdef TEST_COUNT @@ -1089,6 +1090,7 @@ test-postgres: test-postgres-docker --jsonfile="gotests.json" \ $(GOTESTSUM_RETRY_FLAGS) \ --packages="./..." -- \ + -tags=testsmallbatch \ -timeout=20m \ -count=1 .PHONY: test-postgres @@ -1161,7 +1163,7 @@ test-postgres-docker: # Make sure to keep this in sync with test-go-race from .github/workflows/ci.yaml. test-race: - $(GIT_FLAGS) gotestsum --junitfile="gotests.xml" -- -race -count=1 -parallel 4 -p 4 ./... + $(GIT_FLAGS) gotestsum --junitfile="gotests.xml" -- -tags=testsmallbatch -race -count=1 -parallel 4 -p 4 ./... .PHONY: test-race test-tailnet-integration: @@ -1171,6 +1173,7 @@ test-tailnet-integration: TS_DEBUG_NETCHECK=true \ GOTRACEBACK=single \ go test \ + -tags=testsmallbatch \ -exec "sudo -E" \ -timeout=5m \ -count=1 \ diff --git a/go.mod b/go.mod index 9b5e59aa3e..78618d82ea 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ replace tailscale.com => github.com/coder/tailscale v1.1.1-0.20250829055706-6eaf // This is replaced to include // 1. a fix for a data race: c.f. https://github.com/tailscale/wireguard-go/pull/25 // 2. update to the latest gVisor -replace github.com/tailscale/wireguard-go => github.com/coder/wireguard-go v0.0.0-20240522052547-769cdd7f7818 +replace github.com/tailscale/wireguard-go => github.com/coder/wireguard-go v0.0.0-20260113101225-9b7a56210e49 // Switch to our fork that imports fixes from http://github.com/tailscale/ssh. // See: https://github.com/coder/coder/issues/3371 diff --git a/go.sum b/go.sum index 7414f75bd1..1f7575a042 100644 --- a/go.sum +++ b/go.sum @@ -974,8 +974,8 @@ github.com/coder/websocket v1.8.13 h1:f3QZdXy7uGVz+4uCJy2nTZyM0yTBj8yANEHhqlXZ9F github.com/coder/websocket v1.8.13/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs= github.com/coder/wgtunnel v0.2.0 h1:yy9dE9ntoNdx/q98CH9uV2cQk1UEKSwPgITy3Xx+Wiw= github.com/coder/wgtunnel v0.2.0/go.mod h1:4Ne8vzzdHwkM9BnPW2zDvidvFi5IfEbkecx5JH+0zjY= -github.com/coder/wireguard-go v0.0.0-20240522052547-769cdd7f7818 h1:bNhUTaKl3q0bFn78bBRq7iIwo72kNTvUD9Ll5TTzDDk= -github.com/coder/wireguard-go v0.0.0-20240522052547-769cdd7f7818/go.mod h1:fAlLM6hUgnf4Sagxn2Uy5Us0PBgOYWz+63HwHUVGEbw= +github.com/coder/wireguard-go v0.0.0-20260113101225-9b7a56210e49 h1:go72mN+u8M26ji5XE3N2qV+h136Ie0ZBjq+Ccf4wig0= +github.com/coder/wireguard-go v0.0.0-20260113101225-9b7a56210e49/go.mod h1:fAlLM6hUgnf4Sagxn2Uy5Us0PBgOYWz+63HwHUVGEbw= github.com/containerd/continuity v0.4.5 h1:ZRoN1sXq9u7V6QoHMcVWGhOwDFqZ4B9i5H6un1Wh0x4= github.com/containerd/continuity v0.4.5/go.mod h1:/lNJvtJKUQStBzpVQ1+rasXO1LAWtUQssk28EZvJ3nE= github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI=