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

x/sys: unix/syscall_linux_test.go:TestTime is flaky #33200

Open
QuLogic opened this issue Jul 20, 2019 · 0 comments

Comments

@QuLogic
Copy link

commented Jul 20, 2019

In golang.org/x/sys/unix/syscall_linux_test.go, the TestTime function is flaky. It calls unix.Time and time.Now and compares them for strict equality.

These values are only good to 1-second precision, but since the calls do not occur at exactly the same time, there is still a possibility that the latter call could refer to next second. The strict equality check does not account for this and so the test sporadically fails whenever you happen to hit that rollover between both function calls.

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

$ go version
go version go1.12.2 linux/amd64

Does this issue reproduce with the latest release?

Yes.

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

It's an automated rebuild, so I can't get go env output, but it's running on ppc64le.

What did you do?

Run tests for golang.org/x/sys.

What did you expect to see?

Tests pass.

What did you see instead?

Sporadic failures here with an off-by-one difference:

Time: return value 1563602573 should be nearly equal to time.Now().Unix() 1563602574

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.