Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
spikecurtis merged 2 commits intomainfromspike/clock-testing-configmaps
Jun 5, 2024

Conversation

spikecurtis
Copy link
Contributor

@spikecurtisspikecurtis commentedJun 5, 2024
edited
Loading

AddNow(),Since(),AfterFunc() to clock

Useclock for configmaps test

@spikecurtisGraphite App
Copy link
ContributorAuthor

spikecurtis commentedJun 5, 2024
edited
Loading

@spikecurtisspikecurtis marked this pull request as ready for reviewJune 5, 2024 09:58
@spikecurtisspikecurtisforce-pushed thespike/clock-testing-example branch fromddbd5b9 to9492dacCompareJune 5, 2024 10:01
@spikecurtisspikecurtisforce-pushed thespike/clock-testing-configmaps branch fromec72835 to1da8c45CompareJune 5, 2024 10:01
Comment on lines -633 to -639
// 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)
Copy link
Member

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?

Copy link
ContributorAuthor

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.

johnstcn reacted with hooray emoji
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nice!

@spikecurtisspikecurtisforce-pushed thespike/clock-testing-example branch from9492dac to087459cCompareJune 5, 2024 11:37
Base automatically changed fromspike/clock-testing-example tomainJune 5, 2024 11:49
@spikecurtisspikecurtisforce-pushed thespike/clock-testing-configmaps branch from1da8c45 tod5ad7acCompareJune 5, 2024 11:49
@spikecurtisGraphite App
Copy link
ContributorAuthor

spikecurtis commentedJun 5, 2024
edited
Loading

Merge activity

  • Jun 5, 7:50 AM EDT:Graphite rebased this pull request after merging its parent, because this pull request is set to merge when ready.
  • Jun 5, 8:00 AM EDT:@spikecurtis merged this pull request withGraphite.

@spikecurtisspikecurtis merged commit775fc3f intomainJun 5, 2024
@spikecurtisspikecurtis deleted the spike/clock-testing-configmaps branchJune 5, 2024 12:00
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJun 5, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

@mafredrimafredriAwaiting requested review from mafredri

Assignees

@spikecurtisspikecurtis

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@spikecurtis@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp