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

runtime: TestPingPongHog fail randomly on linux/arm64 #20494

Closed
williamweixiao opened this issue May 25, 2017 · 8 comments

Comments

Projects
None yet
5 participants
@williamweixiao
Copy link
Member

commented May 25, 2017

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

go version devel +2d20ded Sat May 20 00:45:56 2017 +0000 linux/arm64

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

GOARCH="arm64"
GOBIN=""
GOEXE=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/weixia01/go"
GORACE=""
GOROOT="/home/weixia01/workspace/llt/golang/golang"
GOTOOLDIR="/home/weixia01/workspace/llt/golang/golang/pkg/tool/linux_arm64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build257642744=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

$cd src/runtime
$go test -run="TestPingPongHog"

What did you expect to see?

PASS

What did you see instead?

--- FAIL: TestPingPongHog (0.15s)
proc_test.go:434: want hogCount/lightCount in [0.5, 2]; got 23000000/11097000 = 2.072632242948545
FAIL
exit status 1

@williamweixiao

This comment has been minimized.

Copy link
Member Author

commented May 25, 2017

I'm not sure whether the required range [0.5, 2] is reasonable.
I would appreciate it if someone can shed some light on the range.

@mvdan mvdan added the Testing label May 25, 2017

@mvdan

This comment has been minimized.

Copy link
Member

commented May 25, 2017

How often does it fail? Does -race affect the frequency? I guess you used something like go test -run=TestPingPongHog -count 1000 to try many times and get a few failures?

@williamweixiao

This comment has been minimized.

Copy link
Member Author

commented May 31, 2017

The failure rate is about: 458/1000 (-count 1000)
The "-race" is only supported on amd64 and I can't use it on arm64.

@williamweixiao

This comment has been minimized.

Copy link
Member Author

commented May 31, 2017

I find there are failures even for amd64 but the rate is very small: 24/1000.
The "-race" will improve the failure rate to: 100%.
So it seems that arm64 just amplify the failure probability.

@williamweixiao

This comment has been minimized.

Copy link
Member Author

commented May 31, 2017

/cc @ianlancetaylor @bradfitz
any comments on the failure rate?

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented May 31, 2017

I just ran the test 1000 times on amd64 and saw 39 failures. The smallest ratio I saw was 0.4875967574815627 and the largest was 2.5314388371713212.

@aclements wrote the test so I will let him decide what to do.

@ianlancetaylor ianlancetaylor added this to the Go1.9 milestone May 31, 2017

@aclements

This comment has been minimized.

Copy link
Member

commented Jun 5, 2017

I think we can just expand the range a bit. There's was nothing special about the 2X. If this test weren't working, I would expect the gap to be closer to 1000X.

@gopherbot

This comment has been minimized.

Copy link

commented Jun 5, 2017

CL https://golang.org/cl/44859 mentions this issue.

@gopherbot gopherbot closed this in d263e85 Jun 5, 2017

@golang golang locked and limited conversation to collaborators Jun 5, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.