diff options
Diffstat (limited to 'vendor/github.com/go-ldap/ldap/conn_test.go')
-rw-r--r-- | vendor/github.com/go-ldap/ldap/conn_test.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/vendor/github.com/go-ldap/ldap/conn_test.go b/vendor/github.com/go-ldap/ldap/conn_test.go index 10766bbd4..488754d16 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 TestConn(t *testing.T) { +func TestFinishMessage(t *testing.T) { ptc := newPacketTranslatorConn() defer ptc.Close() @@ -174,16 +174,12 @@ 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): @@ -192,7 +188,7 @@ func runWithTimeout(t *testing.T, timeout time.Duration, f func()) { } } -// packetTranslatorConn is a helful type which can be used with various tests +// packetTranslatorConn is a helpful type which can be used with various tests // in this package. It implements the net.Conn interface to be used as an // underlying connection for a *ldap.Conn. Most methods are no-ops but the // Read() and Write() methods are able to translate ber-encoded packets for @@ -245,7 +241,7 @@ func (c *packetTranslatorConn) Read(b []byte) (n int, err error) { } // SendResponse writes the given response packet to the response buffer for -// this conection, signalling any goroutine waiting to read a response. +// this connection, signalling any goroutine waiting to read a response. func (c *packetTranslatorConn) SendResponse(packet *ber.Packet) error { c.lock.Lock() defer c.lock.Unlock() |