From d3b35cba4257d9a6ba478e5449fb785e7e0397c6 Mon Sep 17 00:00:00 2001 From: wit liu <765765346@qq.com> Date: Fri, 19 Dec 2025 12:19:47 +0800 Subject: [PATCH] rpc: fix a flaky test of the websocket #33002 (#1877) --- rpc/client_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc/client_test.go b/rpc/client_test.go index e980d0601a..a335801bf6 100644 --- a/rpc/client_test.go +++ b/rpc/client_test.go @@ -971,7 +971,7 @@ func (l *flakeyListener) Accept() (net.Conn, error) { c, err := l.Listener.Accept() if err == nil { - timeout := time.Duration(rand.Int63n(int64(l.maxKillTimeout))) + timeout := max(time.Millisecond*10, time.Duration(rand.Int63n(int64(l.maxKillTimeout)))) time.AfterFunc(timeout, func() { log.Debug(fmt.Sprintf("killing conn %v after %v", c.LocalAddr(), timeout)) c.Close()