Skip to content

Commit 83978e7

Browse files
committed
fix
1 parent fa0f381 commit 83978e7

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

coderd/notifications/manager_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ import (
77
"testing"
88
"time"
99

10-
"github.com/coder/serpent"
1110
"github.com/google/uuid"
1211
"github.com/stretchr/testify/assert"
1312
"github.com/stretchr/testify/require"
1413
"golang.org/x/xerrors"
1514

15+
"github.com/coder/serpent"
16+
1617
"github.com/coder/coder/v2/coderd/database"
1718
"github.com/coder/coder/v2/coderd/database/dbgen"
1819
"github.com/coder/coder/v2/coderd/notifications"

coderd/notifications/notifications_test.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,7 @@ func TestNotifierPaused(t *testing.T) {
542542
t.Parallel()
543543

544544
// setup
545-
ctx := testutil.Context(t, testutil.WaitLong)
546-
logger := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true, IgnoredErrorIs: []error{}}).Leveled(slog.LevelDebug)
547-
db := dbmem.New() // FIXME https://github.com/coder/coder/pull/13863
545+
ctx, logger, db := setupInMemory(t)
548546

549547
// Prepare the test
550548
handler := &fakeHandler{}
@@ -571,7 +569,7 @@ func TestNotifierPaused(t *testing.T) {
571569
require.Eventually(t, func() bool {
572570
handler.mu.RLock()
573571
defer handler.mu.RUnlock()
574-
return handler.succeeded == sid.String()
572+
return slices.Contains(handler.succeeded, sid.String())
575573
}, testutil.WaitShort, testutil.IntervalFast)
576574

577575
// Pause the notifier.
@@ -601,7 +599,7 @@ func TestNotifierPaused(t *testing.T) {
601599
require.Eventually(t, func() bool {
602600
handler.mu.RLock()
603601
defer handler.mu.RUnlock()
604-
return handler.succeeded == sid.String()
602+
return slices.Contains(handler.succeeded, sid.String())
605603
}, testutil.WaitShort, testutil.IntervalFast)
606604
}
607605

0 commit comments

Comments
 (0)