Skip to content

Fix race in TestHandlerDispatchInternal #1895

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

joshua-kim
Copy link
Contributor

@joshua-kim joshua-kim commented Aug 22, 2023

Why this should be merged

Fixes a flaky test: https://github.com/ava-labs/avalanchego/actions/runs/5944721471/job/16122496896?pr=1894

How this works

Instead of timing out, just block until we get the call.

How this was tested

Existing UT

@@ -311,7 +311,6 @@ func TestHandlerDropsGossipDuringBootstrapping(t *testing.T) {
func TestHandlerDispatchInternal(t *testing.T) {
require := require.New(t)

calledNotify := make(chan struct{}, 1)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could also just keep the channel instead of using a waitgroup.

@joshua-kim joshua-kim self-assigned this Aug 22, 2023
@joshua-kim joshua-kim added the ci This focuses on changes to the CI process label Aug 22, 2023
@StephenButtolph StephenButtolph added cleanup Code quality improvement testing This primarily focuses on testing and removed ci This focuses on changes to the CI process labels Aug 22, 2023
@StephenButtolph StephenButtolph added this to the v1.10.9 milestone Aug 22, 2023
@StephenButtolph StephenButtolph merged commit d873f10 into ava-labs:dev Aug 22, 2023
@joshua-kim joshua-kim deleted the TestHandlerDispatchInternal-race branch August 22, 2023 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code quality improvement testing This primarily focuses on testing
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants