From cf629e0a51d667eb2a6efab54436e2fa59dc596c Mon Sep 17 00:00:00 2001 From: Sunny Date: Thu, 5 Nov 2026 15:43:21 +0000 Subject: [PATCH] =?UTF-8?q?test(bootstrap):=20=E8=BF=90=E8=A1=8C=E6=97=B6?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=20-=20=E5=85=B3=E9=97=AD=E5=89=8D=E6=B8=85?= =?UTF-8?q?=E6=8E=89=E5=AE=A2=E6=88=B7=E7=AB=AF=E7=A9=BA=E9=97=B2=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=EF=BC=8C=E4=BF=AE=E5=81=B6=E5=8F=91=E8=B6=85=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- backend/internal/bootstrap/runtime_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/internal/bootstrap/runtime_test.go b/backend/internal/bootstrap/runtime_test.go index 730cda8d8..bbb5f5087 100644 --- a/backend/internal/bootstrap/runtime_test.go +++ b/backend/internal/bootstrap/runtime_test.go @@ -196,6 +196,9 @@ func TestRuntimeOpenStartClose(t *testing.T) { t.Fatalf("desktop unknown proxy path status = %d, want %d", unknownProxyResponse.StatusCode, http.StatusNotFound) } + // 客户端可能多拨了一条从没发过请求的连接放在空闲池里;服务端要等它满 5 秒才算空闲, + // 正好撞上 5 秒的关闭时限。先关掉客户端的空闲连接,只检查运行时自己的关闭。 + http.DefaultClient.CloseIdleConnections() if err := runtime.Close(context.Background()); err != nil { t.Fatal(err) }