From 7e83399a3fadf10c783aac69da27a2be2fca6157 Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Sat, 18 Apr 2026 20:59:11 +0800 Subject: [PATCH] chore: update comments to clarify why need retry in TestDialer --- listener/inbound/common_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/listener/inbound/common_test.go b/listener/inbound/common_test.go index 6c980a924..ace5f6379 100644 --- a/listener/inbound/common_test.go +++ b/listener/inbound/common_test.go @@ -64,8 +64,10 @@ func (t *TestDialer) DialContext(ctx context.Context, network, address string) ( start: conn, err := t.dialer.DialContext(ctx, network, address) if err != nil && ctx.Err() == nil { - // we are testing in local, should never fail, so just retry when ctx not canceled - // it usually happens when the test is running in parallel + // We are conducting tests locally, and they shouldn't fail. + // However, a large number of requests in a short period during concurrent testing can exhaust system ports. + // This can lead to various errors such as WSAECONNREFUSED and WSAENOBUFS. + // So we just retry if the context is not canceled. goto start } return conn, err