Skip to content
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

Remove an un-necessary go routine in a test #432

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

duricanikolic
Copy link
Contributor

@duricanikolic duricanikolic commented Nov 17, 2023

What this PR does:
TestBatchTracker_Record introduced in #430 contains an un-necessary go routine in which we just wait for a WaitGroup, as remarked here. This PR removes that go routine.

Checklist

  • Tests updated
  • [na] CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
@duricanikolic duricanikolic self-assigned this Nov 17, 2023
@duricanikolic duricanikolic merged commit de89bac into main Nov 17, 2023
3 checks passed
@duricanikolic duricanikolic deleted the yuri/successful-trackers branch November 17, 2023 14:02
go func() {
wg.Wait()
}()
wg.Wait()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to wait on the WaitGroup at all? Won't the select below block?

If you want to ensure the goroutine terminates, perhaps moving this below the select would be best. Or this could even be simplified to have the goroutine close a channel once the loop is complete, and then the test can wait for that channel to be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants