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

cmd/compile,test: issue24491b.go seems flaky on linux-386-sid #41361

Closed
cuonglm opened this issue Sep 13, 2020 · 3 comments
Closed

cmd/compile,test: issue24491b.go seems flaky on linux-386-sid #41361

cuonglm opened this issue Sep 13, 2020 · 3 comments

Comments

@cuonglm
Copy link
Contributor

@cuonglm cuonglm commented Sep 13, 2020

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

$ go version
go version devel +5f1b12bfbe Sun Sep 13 04:35:35 2020 +0000 linux/amd64

Does this issue reproduce with the latest release?

No

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

go env Output
$ go env
GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/cuonglm/.cache/go-build"
GOENV="/home/cuonglm/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/cuonglm/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/cuonglm/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/cuonglm/sources/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/cuonglm/sources/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/cuonglm/sources/go/src/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 -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build629252996=/tmp/go-build -gno-record-gcc-switches"

What did you do?

What did you expect to see?

go tool dist test passes.

What did you see instead?

Test fails on builder: https://build.golang.org/log/72b1813880f8c739753c10320bc0ca2745aa73f9

go run run.go -- fixedbugs/issue24491b.go
exit status 2
panic: GC late

goroutine 1 [running]:
main.after(0x900e018)
	/workdir/go/test/fixedbugs/issue24491b.go:39 +0x54
main.main()
	/workdir/go/test/fixedbugs/issue24491b.go:45 +0x2e

FAIL	fixedbugs/issue24491b.go	0.111s
2020/09/13 04:48:44 Failed: exit status 1
go tool dist: FAILED

The test was added in 1f45216, and builder on this commit passed. The builder fails when commit 5f1b12b was submitted, it's a refactoring only, so it's not clear to me yet why the test can be failed.

cc @mdempsky

@cuonglm
Copy link
Contributor Author

@cuonglm cuonglm commented Sep 13, 2020

Hmm, seems the test itself is flaky, it's also failed on arm for commit 1f45216

https://build.golang.org/log/92bdd2a76057a83c2a446d140634708d57aaf169

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Sep 13, 2020

Oh, probably because runtime.GC() doesn't guarantee the finalizer has run. (I guess that's why I used channels in the other test cases I wrote.)

That's probably the best fix here too. Change done to a channel; make the finalizer close it; have before check that it's not closed (non-blocking receive using select); and have after check that it is closed (blocking receive).

@gopherbot
Copy link

@gopherbot gopherbot commented Sep 13, 2020

Change https://golang.org/cl/254401 mentions this issue: test: fix flaky test for issue24491

@gopherbot gopherbot closed this in afb5fca Sep 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.