Skip to content
Merged
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
Next Next commit
Deal with test goroutines
Signed-off-by: Spike Curtis <spike@coder.com>
  • Loading branch information
spikecurtis committed May 25, 2023
commit bbc8c4af9d9b9738017e27dba066c9bfd062556a
5 changes: 3 additions & 2 deletions coderd/database/pubsub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ func TestPubsub_Disconnect(t *testing.T) {
defer pubsub.Close()
event := "test"

errors := make(chan error)
messages := make(chan string)
// buffer responses so that when the test completes, goroutines don't get blocked & leak
errors := make(chan error, database.PubsubBufferSize)
messages := make(chan string, database.PubsubBufferSize)
readOne := func() (m string, e error) {
t.Helper()
select {
Expand Down