-
Notifications
You must be signed in to change notification settings - Fork 881
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏻
coderd/notifications/manager.go
Outdated
@@ -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) |
There was a problem hiding this comment.
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 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
coderd/notifications/manager_test.go
Outdated
// SETUP | ||
|
||
// nolint:gocritic // Unit test. | ||
ctx := dbauthz.AsSystemRestricted(testutil.Context(t, testutil.WaitSuperLong)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 🍝
Fixes coder/internal#544