Skip to content

Commit b826f39

Browse files
authored
Merge pull request kubernetes-sigs#1567 from vincepri/disable-gotest-parallel-mac
🌱 Limit parallel go test executions on MacOS
2 parents 1e4d87c + 47023c0 commit b826f39

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

hack/test-all.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,19 @@ source $(dirname ${BASH_SOURCE})/common.sh
2020

2121
header_text "running go test"
2222

23-
go test -race ${MOD_OPT} ./...
23+
# On MacOS there is a strange race condition
24+
# between port allocation of envtest suites when go test
25+
# runs all the tests in parallel without any limits (spins up around 10+ environments).
26+
#
27+
# To avoid flakes, set we're setting the go-test parallel flag to
28+
# to limit the number of parallel executions.
29+
#
30+
# TODO(community): Investigate this behavior further.
31+
if [[ "${OSTYPE}" == "darwin"* ]]; then
32+
P_FLAG="-p=1"
33+
fi
34+
35+
go test -race ${P_FLAG} ${MOD_OPT} ./...
2436

2537
if [[ -n ${ARTIFACTS:-} ]]; then
2638
if grep -Rin '<failure type="Failure">' ${ARTIFACTS}/*; then exit 1; fi

0 commit comments

Comments
 (0)