MCPcopy
hub / github.com/segmentio/kafka-go / TestDialerConnectTLSHonorsContext

Function TestDialerConnectTLSHonorsContext

dialer_test.go:286–304  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

284}
285
286func TestDialerConnectTLSHonorsContext(t *testing.T) {
287 config := tlsConfig(t)
288 d := &Dialer{
289 TLS: config,
290 }
291
292 conn := &MockConn{
293 done: make(chan struct{}),
294 }
295
296 ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*25)
297 defer cancel()
298
299 _, err := d.connectTLS(ctx, conn, d.TLS)
300 if !errors.Is(err, context.DeadlineExceeded) {
301 t.Errorf("expected err to be %v; got %v", context.DeadlineExceeded, err)
302 t.FailNow()
303 }
304}
305
306func TestDialerResolver(t *testing.T) {
307 ctx := context.TODO()

Callers

nothing calls this directly

Calls 2

connectTLSMethod · 0.95
tlsConfigFunction · 0.85

Tested by

no test coverage detected