Skip to content

test: fix acceptance tests on Apple Silicon Macs#450

Closed
peanball wants to merge 1 commit intodevelopfrom
macos-docker-test-fix
Closed

test: fix acceptance tests on Apple Silicon Macs#450
peanball wants to merge 1 commit intodevelopfrom
macos-docker-test-fix

Conversation

@peanball
Copy link
Copy Markdown
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
Comment thread scripts/create-docker-container.bash Outdated
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
Copy Markdown
Member

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

@peanball
Copy link
Copy Markdown
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
Copy Markdown
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
@maxmoehl
Copy link
Copy Markdown
Member

maxmoehl commented Mar 1, 2026

I'll go ahead and close this for now. If you manage to find a fix please open this again or create a new PR.

@maxmoehl maxmoehl closed this Mar 1, 2026
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Done in Application Runtime Platform Working Group Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants