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

test: fix a race in TestReinit#17902

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
SasSwart merged 1 commit intomainfromjjs/internal-632
May 19, 2025
Merged

test: fix a race in TestReinit#17902

SasSwart merged 1 commit intomainfromjjs/internal-632
May 19, 2025

Conversation

SasSwart
Copy link
Contributor

closescoder/internal#632

pubsubReinitSpy used to signal that a subscription had happened before it actually had.
This created a slight opportunity for the main goroutine to publish before the actual subscription was listening. The published event was then dropped, leading to a failed test.

@SasSwartSasSwart changed the titletest: Fix a race in TestReinittest: fix a race in TestReinitMay 19, 2025
@SasSwartSasSwart marked this pull request as ready for reviewMay 19, 2025 07:58
Comment on lines +2707 to 2708
cancel, err = p.Pubsub.Subscribe(event, listener)
p.Lock()
Copy link
Member

Choose a reason for hiding this comment

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

Would it not make more sense to move the subscribe call after we lock the spy's mutex?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think so; the mutex is protecting theexpectedEvent andtriedToSubscribe, not the underlying pubsub.

@SasSwartSasSwart merged commitc775ea8 intomainMay 19, 2025
40 checks passed
@SasSwartSasSwart deleted the jjs/internal-632 branchMay 19, 2025 09:37
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 19, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@johnstcnjohnstcnjohnstcn left review comments

@spikecurtisspikecurtisspikecurtis approved these changes

Assignees

@SasSwartSasSwart

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

flake: TestReinit
3 participants
@SasSwart@johnstcn@spikecurtis

[8]ページ先頭

©2009-2025 Movatter.jp