Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix acceptance tests on Apple Silicon Macs #450

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion scripts/create-docker-container.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,24 @@ else
ARGS="${*}"
fi

# disable asyncpreempt on MacOS ARM64 (Apple Silicon) as it may cause sporadic errors in emulation
# see: https://github.com/golang/go/issues/42774
DISABLE_ASYNC_PREEMPT=
if [ "$(uname -sm)" == "Darwin arm64" ]; then
DISABLE_ASYNC_PREEMPT='--env GODEBUG=asyncpreemptoff=1'
fi

docker pull "${IMAGE}"
docker rm -f $CONTAINER_NAME
docker run -it \
--env "DB=${DB}" \
--env "REPO_NAME=$REPO_NAME" \
--env "REPO_PATH=/repo" \
$DISABLE_ASYNC_PREEMPT \
--rm \
--name "$CONTAINER_NAME" \
-v "${REPO_PATH}:/repo" \
-v "${CI}:/ci" \
${ARGS} \
"${IMAGE}" \
/bin/bash