Skip to content

Commit

Permalink
fix: consume all entries from the channel to prevent blocking by the …
Browse files Browse the repository at this point in the history
…connection go-ldap#319
  • Loading branch information
t2y committed Jun 4, 2023
1 parent 698ccfe commit 7279710
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ldap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ func TestSearchWithChannelAndCancel(t *testing.T) {
cancel()
}
}
for range ch {
t.Log("Consume all entries from the channel to prevent blocking by the connection")
}
if len(srs) != cancelNum {
t.Errorf("Got entries %d, expected %d", len(srs), cancelNum)
}
Expand Down
3 changes: 3 additions & 0 deletions v3/ldap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ func TestSearchWithChannelAndCancel(t *testing.T) {
cancel()
}
}
for range ch {
t.Log("Consume all entries from the channel to prevent blocking by the connection")
}
if len(srs) != cancelNum {
t.Errorf("Got entries %d, expected %d", len(srs), cancelNum)
}
Expand Down

0 comments on commit 7279710

Please sign in to comment.