Skip to content

Commit

Permalink
Merge pull request #1567 from vincepri/disable-gotest-parallel-mac
Browse files Browse the repository at this point in the history
馃尡 Limit parallel go test executions on MacOS
  • Loading branch information
k8s-ci-robot committed Jun 22, 2021
2 parents 1e4d87c + 47023c0 commit b826f39
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion hack/test-all.sh
Expand Up @@ -20,7 +20,19 @@ source $(dirname ${BASH_SOURCE})/common.sh

header_text "running go test"

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

go test -race ${P_FLAG} ${MOD_OPT} ./...

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

0 comments on commit b826f39

Please sign in to comment.