Skip to content

Commit

Permalink
🌱 Disable parallel go test executions on MacOS
Browse files Browse the repository at this point in the history
Signed-off-by: Vince Prignano <vincepri@vmware.com>
  • Loading branch information
vincepri committed Jun 22, 2021
1 parent 44a4c03 commit 54e6983
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion hack/test-all.sh
Expand Up @@ -20,7 +20,18 @@ 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 (spins up around 10 or so environments).
#
# To avoid flakes, set -p=1 to disable parallel go test 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 54e6983

Please sign in to comment.