Browse Source

tls: fix flaky TestHandshakeConnectionCancellations test (#1896)

pull/1921/head
Marten Seemann 2 years ago
committed by GitHub
parent
commit
683bc67a37
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      p2p/security/tls/transport_test.go

2
p2p/security/tls/transport_test.go

@ -324,7 +324,7 @@ func TestHandshakeConnectionCancellations(t *testing.T) {
}()
ctx, cancel := context.WithCancel(context.Background())
cancel()
_, err = clientTransport.SecureOutbound(ctx, clientInsecureConn, serverID)
_, err = clientTransport.SecureOutbound(ctx, &delayedConn{Conn: clientInsecureConn, delay: 5 * time.Millisecond}, serverID)
require.ErrorIs(t, err, context.Canceled)
require.Error(t, <-errChan)
})

Loading…
Cancel
Save