Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: resolve flake test on manager #17702

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
merged 8 commits into from
May 8, 2025
Merged

fix: resolve flake test on manager #17702

merged 8 commits into from
May 8, 2025

Conversation

defelmnq
Copy link
Contributor

@defelmnq defelmnq commented May 7, 2025

@defelmnq defelmnq requested a review from mafredri May 7, 2025 13:57
@defelmnq defelmnq self-assigned this May 7, 2025
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏻

@@ -141,6 +141,7 @@ func (m *Manager) Run(ctx context.Context) {
m.log.Info(ctx, "started")

m.runOnce.Do(func() {
m.notifier = newNotifier(ctx, m.cfg, uuid.New(), m.log, m.store, m.handlers, m.helpers, m.metrics, m.clock)
Copy link
Member

Choose a reason for hiding this comment

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

Let's add a comment still why we're initializing this here so it doesn't move by accident 👍🏻

Copy link
Member

Choose a reason for hiding this comment

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

I think @defelmnq is on PTO, @mafredri would you mind adding the comment so we can merge it?

PS. not sure what happened that 9 CI jobs failed here...

Copy link
Member

@mafredri mafredri May 8, 2025

Choose a reason for hiding this comment

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

I think the Run and Close of the manager is still racy, probably needs a mutex to avoid Run after Close, etc.

@mafredri mafredri requested a review from mtojek May 8, 2025 12:48
// SETUP

// nolint:gocritic // Unit test.
ctx := dbauthz.AsSystemRestricted(testutil.Context(t, testutil.WaitSuperLong))
Copy link
Member

Choose a reason for hiding this comment

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

nit: testutil.WaitSuperLong - can we shorten the period?

Copy link
Member

Choose a reason for hiding this comment

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

For sure, this was copy 🍝

@mafredri mafredri merged commit 1bb96b8 into main May 8, 2025
34 checks passed
@mafredri mafredri deleted the internal-544 branch May 8, 2025 13:49
@github-actions github-actions bot locked and limited conversation to collaborators May 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flake: Data race in coderd/notifications.(*Manager) (loop/Stop assign/read of m.notifier)
3 participants