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

Conversation

peanball
Copy link
Contributor

We observed sporadic compilation or bytecode issues
on Apple Silicon Macs.

According to golang/go#42774,
the env variable GODEBUG=asyncpreemptoff=1 works around
the issue by disabling asynchronous preemption of
goroutines.

This might impact garbage collection performance, but restores
the same level of reliability to locally running tests as
when run in Docker on an Intel based Mac.

The GODEBUG=asyncpreemptoff=1 variable is set when creating
the Docker container for running tests locally, and applies
to all Go code, including go vet, for which we also observed
sporadic issues.

@peanball peanball requested a review from a team as a code owner January 13, 2025 15:36
@peanball peanball force-pushed the macos-docker-test-fix branch from dc22931 to 077755f Compare January 14, 2025 10:00
maxmoehl
maxmoehl previously approved these changes Jan 14, 2025
scripts/create-docker-container.bash Outdated Show resolved Hide resolved
We observed sporadic compilation or bytecode issues
on Apple Silicon Macs.

According to golang/go#42774,
the env variable `GODEBUG=asyncpreemptoff=1` works around
the issue by disabling asynchronous preemption of
goroutines.

This might impact garbage collection performance, but restores
the same level of reliability to locally running tests as
when run in Docker on an Intel based Mac.

The `GODEBUG=asyncpreemptoff=1` variable is set when creating
the Docker container for running tests locally, and applies
to all Go code, including `go vet`, for which we also observed
sporadic issues.
@ameowlia
Copy link
Member

❓ Can you show the commands you ran and the errors you got before hand?

@peanball
Copy link
Contributor Author

❓ Can you show the commands you ran and the errors you got before hand?

Command (directly on the Mac, with Docker for Mac installed):

cd routing-release
scripts/test-in-docker.bash

mostly it's lines ending in signal: illegal instruction, as mentioned in golang/go#42774.

...
[1736868869] Registry Suite - 88/88 specs - 7 procs •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• SUCCESS! 5.131790127s
Failed to compile container:

code.cloudfoundry.org/gorouter/registry/container_test: /usr/local/go/pkg/tool/linux_amd64/vet: signal: illegal instruction

...
Ginkgo ran 30 suites in 5m31.781438611s

There were failures detected in the following suites:
  container ./registry/container [Compilation failure]

...

@peanball
Copy link
Contributor Author

ok, so I reran it a couple of times now and occasionally still get the illegal instruction, even with the flag set. I will put it back to draft and check some more things.

It is possible that the env variable is not having an effect in all places, or it just doesn't help.

@peanball peanball marked this pull request as draft January 14, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Pending Merge | Prioritized
Development

Successfully merging this pull request may close these issues.

3 participants