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

go test is very slow on mac m1 #43370

Closed
harsimranmaan opened this issue Dec 24, 2020 · 2 comments
Closed

go test is very slow on mac m1 #43370

harsimranmaan opened this issue Dec 24, 2020 · 2 comments

Comments

@harsimranmaan
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.16beta1 darwin/arm64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/harsimranmaan/Library/Caches/go-build"
GOENV="/Users/harsimranmaan/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/harsimranmaan/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/harsimranmaan/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.16beta1"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/harsimranmaan/dev/h/trober/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/bq/_srrv9lj6lnb7njq65ymhlv80000gn/T/go-build2848924219=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Ran the usual test suite on Mac m1 for my project. Tests usually take around 15s but on m1, take around 2 mins. The source code is available at https://github.com/bigpanther/trober

What did you expect to see?

Expect to see the tests run in under 15s as is the case for non m1 machines.
eg: See https://github.com/bigpanther/trober/runs/1606449367

?   	github.com/bigpanther/trober	[no test files]
ok  	github.com/bigpanther/trober/actions	7.526s	coverage: 57.8% of statements
ok  	github.com/bigpanther/trober/grifts	0.177s	coverage: 71.3% of statements
ok  	github.com/bigpanther/trober/models	0.527s	coverage: 58.5% of statements

What did you see instead?

INFO[0001] go test -p 1 -tags development -coverprofile=coverage.txt -covermode=atomic -race ./...
?   	github.com/bigpanther/trober	[no test files]
ok  	github.com/bigpanther/trober/actions	136.434s	coverage: 57.8% of statements
ok  	github.com/bigpanther/trober/grifts	1.184s	coverage: 71.3% of statements
ok  	github.com/bigpanther/trober/models	14.464s	coverage: 58.5% of statements
@harsimranmaan
Copy link
Author

On further investigation, this does not look like a golang issue. I validated running pure golang tests without third party deps and execution times are as expected. I think the slowness is coming from connectivity to the local docker container.

@harsimranmaan
Copy link
Author

Tried with another project and the tests times are as expected. Closing this issue as I think it does not need attention in this forum.

@golang golang locked and limited conversation to collaborators Dec 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants