Skip to content

Commit 3dd3174

Browse files
committed
wait medium
1 parent 869782b commit 3dd3174

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

coderd/notifications/manager_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,17 @@ func TestRunStopRace(t *testing.T) {
188188
// SETUP
189189

190190
// nolint:gocritic // Unit test.
191-
ctx := dbauthz.AsSystemRestricted(testutil.Context(t, testutil.WaitSuperLong))
191+
ctx := dbauthz.AsSystemRestricted(testutil.Context(t, testutil.WaitMedium))
192192
store, ps := dbtestutil.NewDB(t)
193193
logger := testutil.Logger(t)
194194

195195
// GIVEN: a standard manager
196196
mgr, err := notifications.NewManager(defaultNotificationsConfig(database.NotificationMethodSmtp), store, ps, defaultHelpers(), createMetrics(), logger.Named("notifications-manager"))
197197
require.NoError(t, err)
198198

199+
// Start Run and Stop after each other (run does "go loop()").
200+
// This is to catch a (now fixed) race condition where the manager
201+
// would be accessed/stopped while it was being created/starting up.
199202
mgr.Run(ctx)
200203
err = mgr.Stop(ctx)
201204
require.NoError(t, err)

0 commit comments

Comments
 (0)