Skip to content

Commit 9919352

Browse files
committed
truly limit the number of parallel tests
On-behalf-of: @SAP [email protected]
1 parent 4ac2bd6 commit 9919352

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ test: fmt vet ## Run tests.
6767
# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
6868
.PHONY: test-e2e # Run the e2e tests against a kind k8s instance that is already spun up.
6969
test-e2e:
70-
go test ./test/e2e/ -v
70+
go test ./test/e2e/... -v
7171

7272
# Creates a kind cluster and runs the e2e tests in them. The kind cluster is destroyed after the tests.
7373
.PHONY: test-e2e-with-kind # Run the e2e tests against a temporary kind cluster.

hack/ci/run-e2e-tests.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ E2E_PARALLELISM=${E2E_PARALLELISM:-2}
118118
# Increase file descriptor limit for CI environments
119119
ulimit -n 65536
120120

121+
# -parallel will only control how many tests run in parallel *within a single test package.*
122+
# We however need to limit the overall amount of tests that can run at the same time, since
123+
# the kind cluster does not have infinite capacity. The only way to tell Go to please not
124+
# run all packages at the same time is setting GOMAXPROCS.
125+
export GOMAXPROCS=$E2E_PARALLELISM
126+
121127
(set -x; go test -tags e2e -parallel $E2E_PARALLELISM $TEST_ARGS "$WHAT")
122128

123129
echo "Done. :-)"

hack/run-e2e-tests.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,10 @@ WHAT="${WHAT:-./test/e2e/...}"
101101
TEST_ARGS="${TEST_ARGS:--timeout 2h -v}"
102102
E2E_PARALLELISM=${E2E_PARALLELISM:-2}
103103

104+
# -parallel will only control how many tests run in parallel *within a single test package.*
105+
# We however need to limit the overall amount of tests that can run at the same time, since
106+
# the kind cluster does not have infinite capacity. The only way to tell Go to please not
107+
# run all packages at the same time is setting GOMAXPROCS.
108+
export GOMAXPROCS=$E2E_PARALLELISM
109+
104110
(set -x; go test -tags e2e -parallel $E2E_PARALLELISM $TEST_ARGS "$WHAT")

0 commit comments

Comments
 (0)