Skip to content

Commit bbc8c4a

Browse files
committed
Deal with test goroutines
Signed-off-by: Spike Curtis <spike@coder.com>
1 parent ede1415 commit bbc8c4a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

coderd/database/pubsub_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ func TestPubsub_Disconnect(t *testing.T) {
140140
defer pubsub.Close()
141141
event := "test"
142142

143-
errors := make(chan error)
144-
messages := make(chan string)
143+
// buffer responses so that when the test completes, goroutines don't get blocked & leak
144+
errors := make(chan error, database.PubsubBufferSize)
145+
messages := make(chan string, database.PubsubBufferSize)
145146
readOne := func() (m string, e error) {
146147
t.Helper()
147148
select {

0 commit comments

Comments
 (0)