Skip to content

test(coderd/database/awsiamrds): fix unclosed pubsub #16202

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 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
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
test(coderd/database/awsiamrds): fix unclosed pubsub
  • Loading branch information
mafredri committed Jan 20, 2025
commit c0074c737e93f32a5809e398491159fbdf01469c
3 changes: 2 additions & 1 deletion coderd/database/awsiamrds/awsiamrds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ func TestDriver(t *testing.T) {

ps, err := pubsub.New(ctx, logger, db, url)
require.NoError(t, err)
defer ps.Close()

gotChan := make(chan struct{})
subCancel, err := ps.Subscribe("test", func(_ context.Context, _ []byte) {
close(gotChan)
})
defer subCancel()
require.NoError(t, err)
defer subCancel()

err = ps.Publish("test", []byte("hello"))
require.NoError(t, err)
Expand Down
Loading