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 explicit Wait() to clock.Advance()#13464

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 1 commit intomainfromspike/clock-testing-explicit-wait
Jun 5, 2024

Conversation

spikecurtis
Copy link
Contributor

@spikecurtisspikecurtis commentedJun 4, 2024
edited
Loading

Modifiesclock.Mock.Advance() to allow explicitly waiting for advance to complete. E.g.

mClock.Advance(time.Second).MustWait(ctx, t)

Having the wait be explicit allows you to more easily write tests where the timer or ticker calls back into theclock with something you have a trap set for, e.g.

w := mClock.Advance(time.Second)c, err := trap.Wait(ctx)require.NoError(t, err)c.Release()w.MustWait(ctx, t)

@spikecurtisGraphite App
Copy link
ContributorAuthor

spikecurtis commentedJun 4, 2024
edited
Loading

Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

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

LGTM 👍 I'm assuming the linter complaints are due to stacking.

@spikecurtisspikecurtisforce-pushed thespike/clock-testing-watchdog branch frome243711 to63c9374CompareJune 5, 2024 06:14
@spikecurtisspikecurtisforce-pushed thespike/clock-testing-explicit-wait branch from1f3c4aa tob55fc1aCompareJune 5, 2024 06:14
Base automatically changed fromspike/clock-testing-watchdog tomainJune 5, 2024 09:55
@spikecurtisspikecurtisforce-pushed thespike/clock-testing-explicit-wait branch fromb55fc1a to35daa55CompareJune 5, 2024 09:56
@spikecurtisspikecurtisforce-pushed thespike/clock-testing-explicit-wait branch from35daa55 to6e5decdCompareJune 5, 2024 10:01
@spikecurtisspikecurtis merged commit9c3fd5d intomainJun 5, 2024
@spikecurtisspikecurtis deleted the spike/clock-testing-explicit-wait branchJune 5, 2024 11:37
@spikecurtisGraphite App
Copy link
ContributorAuthor

Merge activity

@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

@mafredrimafredrimafredri approved these changes

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@spikecurtisspikecurtis

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@spikecurtis@mafredri@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp