summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-ldap/ldap/conn_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/go-ldap/ldap/conn_test.go')
-rw-r--r--vendor/github.com/go-ldap/ldap/conn_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/vendor/github.com/go-ldap/ldap/conn_test.go b/vendor/github.com/go-ldap/ldap/conn_test.go
index 30554d23c..10766bbd4 100644
--- a/vendor/github.com/go-ldap/ldap/conn_test.go
+++ b/vendor/github.com/go-ldap/ldap/conn_test.go
@@ -60,7 +60,7 @@ func TestUnresponsiveConnection(t *testing.T) {
// TestFinishMessage tests that we do not enter deadlock when a goroutine makes
// a request but does not handle all responses from the server.
-func TestFinishMessage(t *testing.T) {
+func TestConn(t *testing.T) {
ptc := newPacketTranslatorConn()
defer ptc.Close()
@@ -174,12 +174,16 @@ func testSendUnhandledResponsesAndFinish(t *testing.T, ptc *packetTranslatorConn
}
func runWithTimeout(t *testing.T, timeout time.Duration, f func()) {
+ runtime.Gosched()
+
done := make(chan struct{})
go func() {
f()
close(done)
}()
+ runtime.Gosched()
+
select {
case <-done: // Success!
case <-time.After(timeout):