Skip to content

Commit b951ff5

Browse files
authored
build(e2e): pin the number of suite binaries running at once
-parallel bounds tests inside a binary; -p bounds the binaries and still defaults to GOMAXPROCS, so peak clusters followed the core count. Measured on a harness with the suite's package and test shape: 5 at four cores, 10 at eight, 15 at sixteen. Pinning -p holds it at 5 everywhere. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
1 parent 4c52374 commit b951ff5

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ v1alpha1 is the legacy API; conversion functions exist to v1beta1 (which is the
155155

156156
- Unit/integration tests use `envtest` (embedded Kubernetes API server + etcd); no cluster needed
157157
- E2E tests in `e2e/` use KIND: one directory per suite, each its own Go package and test binary, provisioning its own KIND cluster. Run a single suite with `make test-e2e E2E_TEST=<suite-dir>`. Shared helpers live in `e2e/common/` and `e2e/internal/` and are excluded from suite selection
158-
- E2E knobs (all `make` overrides): `E2E_TEST_TIMEOUT` (per suite binary, default 20m), `E2E_SUITE_PARALLEL` (clusters one suite binary builds at once, default 2 — raising it starves the aggregators on a 4-vCPU runner), `KIND_COMMAND_TIMEOUT` (per kind invocation; derived from `E2E_TEST_TIMEOUT` when unset)
158+
- E2E knobs (all `make` overrides): `E2E_TEST_TIMEOUT` (per suite binary, default 20m), `E2E_SUITE_PARALLEL` (clusters one suite binary builds at once, default 2 — raising it starves the aggregators on a 4-vCPU runner), `E2E_CLUSTERS` (suite binaries at once, default 4; holds peak clusters at 5, which otherwise follows the core count), `KIND_COMMAND_TIMEOUT` (per kind invocation; derived from `E2E_TEST_TIMEOUT` when unset)
159159
- Coverage profile config in `.testcoverage.yml`; tool: `go-test-coverage`
160160
- Test framework: Ginkgo + Gomega for BDD-style tests; testify for unit tests
161161

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ E2E_TEST_TIMEOUT ?= 20m
5858
# otherwise follows the core count and starves the aggregators.
5959
E2E_SUITE_PARALLEL ?= 2
6060

61+
# Suite binaries running at once. Pinned, peak clusters holds at 5; left to -p
62+
# it follows the core count, so eight cores would reach 10 and sixteen 15.
63+
E2E_CLUSTERS ?= 4
64+
6165
TEST_COV_DIR := $(shell mkdir -p build/_test_coverage && realpath build/_test_coverage)
6266

6367
CONTROLLER_GEN := ${BIN}/controller-gen
@@ -247,7 +251,7 @@ test-e2e-nodeps:
247251
KIND_IMAGE="$(KIND_IMAGE)" \
248252
PROJECT_DIR="$(PWD)" \
249253
E2E_TEST_COV_DIR=${TEST_COV_DIR} \
250-
go test -count=1 -v -parallel ${E2E_SUITE_PARALLEL} -timeout ${E2E_TEST_TIMEOUT} $$(go list ./${E2E_TEST}/... | grep -vE '/e2e/(common|internal)(/|$$)')
254+
go test -count=1 -v -p ${E2E_CLUSTERS} -parallel ${E2E_SUITE_PARALLEL} -timeout ${E2E_TEST_TIMEOUT} $$(go list ./${E2E_TEST}/... | grep -vE '/e2e/(common|internal)(/|$$)')
251255
go tool covdata textfmt -i=${TEST_COV_DIR}/covdatafiles -o ${TEST_COV_DIR}/coverage_e2e.out
252256
@echo "--- E2E test coverage report"
253257
go tool covdata percent -i=${TEST_COV_DIR}/covdatafiles

0 commit comments

Comments
 (0)