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

fix: fix TestCloserStack_Timeout to wait for all asyncClosers#19837

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/internal-966-async-closer-race
Sep 16, 2025

Conversation

spikecurtis
Copy link
Contributor

@spikecurtisspikecurtis commentedSep 16, 2025
edited
Loading

fixescoder/internal#966

TestCloserStack_Timeout createsasyncClosers which allow control over the exact timing and order of their close method returning. They also, as a final backstop will throw an error if the test context ends before they are unblocked.

TestCloserStack_Timeout unblocks allasyncClosers in a defer and then ends the test. This deferunblocks the running close goroutines, but does not wait for them to finish. Since the test context is canceled as soon as the test completes, this creates a race condition where the close goroutines can trigger the context cancelled arm of theselect statement.

The fix is to both unblock and wait for all close goroutines to complete before ending the test and cancelling the context.

@spikecurtisGraphite App
Copy link
ContributorAuthor

This stack of pull requests is managed byGraphite. Learn more aboutstacking.

@spikecurtisspikecurtis marked this pull request as ready for reviewSeptember 16, 2025 12:44
@spikecurtisspikecurtis merged commit4fc0093 intomainSep 16, 2025
38 checks passed
@spikecurtisspikecurtis deleted the spike/internal-966-async-closer-race branchSeptember 16, 2025 17:53
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 16, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

Assignees

@spikecurtisspikecurtis

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

flake: panic in TestCloserStack_CloseAfterContext
2 participants
@spikecurtis@mafredri

[8]ページ先頭

©2009-2025 Movatter.jp