- Notifications
You must be signed in to change notification settings - Fork1k
chore: add Now, Since, AfterFunc to clock; use clock for configmaps test#13476
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
spikecurtis commentedJun 5, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This stack of pull requests is managed by Graphite.Learn more about stacking. Join@spikecurtis and the rest of your teammates on |
ddbd5b9
to9492dac
Compareec72835
to1da8c45
Compare// Before we update the clock again, we need to be sure the timeout has | ||
// completed running. To do that, we check the new lastHandshake has been set | ||
require.Eventually(t,func()bool { | ||
uut.L.Lock() | ||
deferuut.L.Unlock() | ||
returnuut.peers[p1ID].lastHandshake==lh | ||
},testutil.WaitShort,testutil.IntervalFast) |
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.
Why do we no longer need this check?
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.
I'm glad you asked! One of the benefits of this library compared withbenbjohnson/clock
is that we can useAdvance().MustWait()
to wait for all theAfterFunc()
functions to run. So, we don't need to userequire.Eventually()
and peer into the internal state in order to ensure the timeout has been processed.
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.
Nice!
9492dac
to087459c
CompareSigned-off-by: Spike Curtis <spike@coder.com>
1da8c45
tod5ad7ac
Comparespikecurtis commentedJun 5, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Merge activity
|
Uh oh!
There was an error while loading.Please reload this page.
Add
Now()
,Since()
,AfterFunc()
to clockUse
clock
for configmaps test