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: TestClockNanosleep failures with CLOCK_REALTIME #42513

Closed
bcmills opened this issue Nov 11, 2020 · 4 comments
Closed

x/sys: TestClockNanosleep failures with CLOCK_REALTIME #42513

bcmills opened this issue Nov 11, 2020 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@bcmills bcmills added OS-Android NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Nov 11, 2020
@gopherbot gopherbot added this to the Unreleased milestone Nov 11, 2020
@bcmills
Copy link
Contributor Author

bcmills commented Nov 11, 2021

greplogs --dashboard -md -l -e 'FAIL: TestClockNanosleep' --since=2021-01-01

2021-11-10T22:16:25-99a5385-4d06839/android-386-emu
2021-11-02T05:35:11-39c9dd3-6f327f7/android-amd64-emu
2021-10-29T02:16:47-69cdffd-2c7cdec/android-amd64-emu
2021-10-27T18:24:50-69cdffd-259735f/android-amd64-emu
2021-10-25T20:41:00-69cdffd-f92c8f0/android-amd64-emu
2021-10-16T14:50:21-69063c4-680caf1/android-amd64-emu
2021-10-12T11:00:47-d303952-9c1dbdf/android-386-emu
2021-10-04T22:00:53-2c5d950-d9952ff/android-amd64-emu
2021-09-30T14:19:18-969570c-bd8009d/android-amd64-emu
2021-09-17T16:11:53-d61c044-abc4f09/android-386-emu
2021-09-03T07:17:46-97244b9-ab7c904/android-amd64-emu
2021-09-03T07:17:12-2934436-ab7c904/android-386-emu
2021-08-17T19:03:40-bfb29a6-ec51703/android-386-emu
2021-08-16T20:23:26-1e6c022-a05a7d4/android-386-emu
2021-08-02T22:28:53-0f9fa26-8b6ae9b/android-amd64-emu
2021-06-24T18:12:53-59db8d7-600a2a4/android-386-emu
2021-06-02T21:39:28-7ecdf8e-dd7ba3b/android-386-emu
2021-05-09T17:07:22-a76c4d0-c14ecac/android-amd64-emu
2021-04-26T23:06:21-413ae7e-be28caf/android-386-emu
2021-04-20T16:00:27-93ed5bc-60ab197/android-amd64-emu
2021-04-12T15:17:33-5e06dd2-117b1c8/android-amd64-emu
2021-04-02T01:14:00-43e1dd7-97b3ce4/android-amd64-emu
2021-03-31T14:33:46-4fbd30e-3a45c13/android-amd64-emu
2021-03-17T19:48:52-3901687-a5df883/android-386-emu
2021-03-16T14:05:45-0b90fd5-8607043/android-amd64-emu
2021-02-25T09:19:47-4ada943-666ad85/android-386-emu
2021-02-18T18:12:04-8ebf48a-f3c2208/android-amd64-emu
2021-02-18T14:52:45-beda7e5-1a7e9af/android-386-emu

@bcmills
Copy link
Contributor Author

bcmills commented Nov 11, 2021

Fix looks straightforward. The failure is always for CLOCK_REALTIME: we're calling ClockNanosleep with an absolute wall time, but then checking the elapsed monotonic duration instead of the wall-time duration.

@bcmills bcmills self-assigned this Nov 11, 2021
@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 11, 2021
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 11, 2021
@bcmills bcmills added Testing An issue that has been verified to require only test changes, not just a test failure. and removed OS-Android labels Nov 11, 2021
@bcmills bcmills changed the title x/sys: TestClockNanosleep failures on android x/sys: TestClockNanosleep failures with CLOCK_REALTIME Nov 11, 2021
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/363456 mentions this issue: unix: in TestClockNanosleep, compare wall times when sleeping until wall times

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/383175 mentions this issue: rate: allow for more timing slop in TestWaitSimple

gopherbot pushed a commit to golang/time that referenced this issue Feb 10, 2022
The 'd' constant is intentionally set fairly long to allow for builder
jitter; however, dFromDuration previously hard-coded only 1ms of
downward timing slop.

That slop can be introduced due to time spent between the call to
WaitN in the previous runWait and the call to time.Now in the current
runWait, and empirically may be a bit larger than 1ms on certain
builders (especially the android-amd64-emu builders, which also have
more clock drift than many other platforms; see golang/go#42513).

In addition, on some BSD platforms the slop in the upward direction
may actually be longer than d no matter how generously d is set. That
appears to be a platform bug (see golang/go#50189).

This change adjusts dFromDuration to round to the nearest d instead of
biasing in one direction or the other, and allows an additional factor
of slop on the affected BSD platforms.

Fixes #44067

Change-Id: Id4c073bee545be2291ad98158d764e19db0160cb
Reviewed-on: https://go-review.googlesource.com/c/time/+/383175
Trust: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Sameer Ajmani <sameer@golang.org>
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
@rsc rsc unassigned bcmills Jun 23, 2022
@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

2 participants