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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
work on flake manager
  • Loading branch information
defelmnq committed May 7, 2025
commit ab8560dbde6a44c515cbc0121499f228fba2c0dd
2 changes: 1 addition & 1 deletion coderd/notifications/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ 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.

// Closes when Stop() is called or context is canceled.
go func() {
m.notifier = newNotifier(ctx, m.cfg, uuid.New(), m.log, m.store, m.handlers, m.helpers, m.metrics, m.clock)
err := m.loop(ctx)
if err != nil {
m.log.Error(ctx, "notification manager stopped with error", slog.Error(err))
Expand Down
Loading