From 72797107f94d3406274fc3d357ec57db3598b42b Mon Sep 17 00:00:00 2001 From: Tetsuya Morimoto Date: Sun, 4 Jun 2023 14:09:27 +0900 Subject: [PATCH] fix: consume all entries from the channel to prevent blocking by the connection #319 --- ldap_test.go | 3 +++ v3/ldap_test.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ldap_test.go b/ldap_test.go index 34199db2..bbeecc9d 100644 --- a/ldap_test.go +++ b/ldap_test.go @@ -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) } diff --git a/v3/ldap_test.go b/v3/ldap_test.go index 34199db2..bbeecc9d 100644 --- a/v3/ldap_test.go +++ b/v3/ldap_test.go @@ -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) }