10000 feat: add killswitch for notifications by mtojek · Pull Request #13794 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: add killswitch for notifications #13794

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 22 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
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
fix
  • Loading branch information
mtojek committed Jul 10, 2024
commit 83978e73c9bcea53223541932e32e2ad0233ea2a
3 changes: 2 additions & 1 deletion coderd/notifications/manager_test.go
Original file line number Diff line number Diff line change
10000 Expand Up @@ -7,12 +7,13 @@ import (
"testing"
"time"

"github.com/coder/serpent"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/xerrors"

"github.com/coder/serpent"

"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/database/dbgen"
"github.com/coder/coder/v2/coderd/notifications"
Expand Down
8 changes: 3 additions & 5 deletions coderd/notifications/notifications_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,7 @@ func TestNotifierPaused(t *testing.T) {
t.Parallel()

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

// Prepare the test
handler := &fakeHandler{}
Expand All @@ -571,7 +569,7 @@ func TestNotifierPaused(t *testing.T) {
require.Eventually(t, func() bool {
handler.mu.RLock()
defer handler.mu.RUnlock()
return handler.succeeded == sid.String()
return slices.Contains(handler.succeeded, sid.String())
}, testutil.WaitShort, testutil.IntervalFast)

// Pause the notifier.
Expand Down Expand Up @@ -601,7 +599,7 @@ func TestNotifierPaused(t *testing.T) {
require.Eventually(t, func() bool {
handler.mu.RLock()
defer handler.mu.RUnlock()
return handler.succeeded == sid.String()
return slices.Contains(handler.succeeded, sid.String())
}, testutil.WaitShort, testutil.IntervalFast)
}

Expand Down
Loading
0