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/time/rate: TestWaitSimple failures due to mismatched delays #44067

Closed
bcmills opened this issue Feb 2, 2021 · 5 comments
Closed

x/time/rate: TestWaitSimple failures due to mismatched delays #44067

bcmills opened this issue Feb 2, 2021 · 5 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Feb 2, 2021

2020-12-08T04:08:08-7e3f01d/android-386-emu
2020-12-08T04:08:08-7e3f01d/android-amd64-emu

--- FAIL: TestWaitSimple (0.20s)
    rate_test.go:409: lim.WaitN(act-later, lim, 3) = <nil> with delay 198.13614ms ; want <nil> with delay 200ms
FAIL

Compare #43055.

@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 2, 2021
@bcmills bcmills added this to the Backlog milestone Feb 2, 2021
@bcmills
Copy link
Contributor Author

bcmills commented Jun 2, 2021

@Sajmani Sajmani self-assigned this Jan 14, 2022
@bcmills
Copy link
Contributor Author

bcmills commented Feb 4, 2022

I think I see two mostly-independent causes here.

One is that the timing slop on NetBSD and OpenBSD is much larger than the test expects (see #50189). I suspect that is also the problem on plan9-arm.

The android failures always seem to be for Wait calls later in the sequence (act-later, which is the fourth call in its test; and will-cancel, which is the second). I suspect that the builder is slow enough — or its clock is adjusted frequently enough — that it is losing a little bit of time in between calls, and the lost time is occasionally enough to push it over a d tick into the next-lower bucket of ticks.

@bcmills
Copy link
Contributor Author

bcmills commented Feb 4, 2022

Indeed, I can get TestWaitSimple to fail on the first try by injecting a time.Sleep(5 * time.Millisecond) just before runWait(… "act-later" …), and I can get TestWaitCancel to fail by injecting a time.Sleep(5 * time.Millisecond) just before runWait(… "will-cancel" …).

@bcmills bcmills self-assigned this Feb 4, 2022
@gopherbot
Copy link

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

@bcmills bcmills closed this as completed Feb 24, 2022
@rsc rsc unassigned bcmills and Sajmani 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 NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants