MCPcopy
hub / github.com/redis/go-redis / startMockMaintNotificationsDowngradeServer

Function startMockMaintNotificationsDowngradeServer

internal_maint_notif_test.go:547–568  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

545}
546
547func startMockMaintNotificationsDowngradeServer(t *testing.T) *mockMaintNotificationsDowngradeServer {
548 t.Helper()
549 ln, err := net.Listen("tcp", "127.0.0.1:0")
550 if err != nil {
551 t.Fatalf("failed to listen: %v", err)
552 }
553 s := &mockMaintNotificationsDowngradeServer{
554 ln: ln,
555 firstPingBlocked: make(chan struct{}),
556 releaseFirstPing: make(chan struct{}),
557 }
558 go func() {
559 for {
560 conn, err := ln.Accept()
561 if err != nil {
562 return
563 }
564 go s.handle(conn)
565 }
566 }()
567 return s
568}
569
570func TestClient_ModeAutoDowngradeRetiresEnabledInUseConnOnPut(t *testing.T) {
571 srv := startMockMaintNotificationsDowngradeServer(t)

Calls 1

handleMethod · 0.95

Tested by

no test coverage detected