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
Get rid of internal/clock - Consolidate AfterFunc and Sleep in tests #39
Conversation
0f0117b
to
8f0d35a
Compare
Rebased it on top of #40 and it looks much better now. I'll raise another PR trying to switch us to andres-erbsen/clock in parallel to make sure we cannot simply do that, without even landing this diff. |
Raised #41 to test - verified that:
|
8f0d35a
to
529e3ae
Compare
change overall looks good, but i think we should split it up into 3 separate changes:
what other work is needed in order to move off of the fork? |
I'm happy to split the fixes, but I won't be adding tests for them - since we're this diff away from removing the fork. The work needed - if this lands, we can drop the fork. |
529e3ae
to
8cf7737
Compare
Resolves #3 Was looking at the open issues and #3 seemed to make sense - it was also something that I saw in #37 so I thought I'd take a stab. The reasoning is that less code + smaller interface is a good thing. During the diff it turned out that: - our internal/clock has no tests - our internal/clock has at least two bugs: -- one that I'm fixing here, related to not executing two timers if they're scheduled at the "now" boundry -- one regarding adding time but not having a timer set for that specific time (not a problem for us, so not touching it) Looking at the internal/clock, we see: ``` // Forked from github.com/andres-erbsen/clock to isolate a missing nap. ``` There's one extra nap in AfterFunc that I'm removing in this diff, and so I'm hoping that by removing AfterFunc we'll eventually be able to move off the fork.
Was untested and contained bugs.
8cf7737
to
d2b91bb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks for making the changes!
Bobjohnson original version seems to be more used (again). Also see history in #39.
Bobjohnson original version seems to be more used (again). Also see history in uber-go#39.
Resolves #3
Was looking at the open issues and #3 seemed to make sense - it was
also something that I saw in #37 so I thought I'd take a stab.
The reasoning is that less code + smaller interface is a good thing.
During the diff it turned out that:
if they're scheduled at the "now" boundry
specific time (not a problem for us, so not touching it)
By dropping afterFunc into Sleep we're able to deprecate the internal
fork altogether - there is a missing nap in andres-erbsen/clock.AfterFunc
that meant we needed our own fork. Now it's not needed.