Skip to content

Commit 7279710

Browse files
committed
fix: consume all entries from the channel to prevent blocking by the connection go-ldap#319
1 parent 698ccfe commit 7279710

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

ldap_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,9 @@ func TestSearchWithChannelAndCancel(t *testing.T) {
401401
cancel()
402402
}
403403
}
404+
for range ch {
405+
t.Log("Consume all entries from the channel to prevent blocking by the connection")
406+
}
404407
if len(srs) != cancelNum {
405408
t.Errorf("Got entries %d, expected %d", len(srs), cancelNum)
406409
}

v3/ldap_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,9 @@ func TestSearchWithChannelAndCancel(t *testing.T) {
401401
cancel()
402402
}
403403
}
404+
for range ch {
405+
t.Log("Consume all entries from the channel to prevent blocking by the connection")
406+
}
404407
if len(srs) != cancelNum {
405408
t.Errorf("Got entries %d, expected %d", len(srs), cancelNum)
406409
}

0 commit comments

Comments
 (0)