fix tests

This commit is contained in:
WeidiDeng 2026-04-21 11:54:36 +08:00
parent b15e3cd2fa
commit 6d4190f4c7
No known key found for this signature in database
GPG Key ID: 25F87CE1741EC7CD

View File

@ -117,8 +117,8 @@ func TestHandlerCleanupLegacyModeClosesAllConnections(t *testing.T) {
ts := newTunnelState(caddy.Log(), 0)
connA := newTrackingReadWriteCloser()
connB := newTrackingReadWriteCloser()
ts.registerConnection(connA, nil, "a")
ts.registerConnection(connB, nil, "b")
ts.registerConnection(connA, nil, false, "a")
ts.registerConnection(connB, nil, false, "b")
h := &Handler{
tunnel: ts,
@ -136,7 +136,7 @@ func TestHandlerCleanupLegacyModeClosesAllConnections(t *testing.T) {
func TestHandlerCleanupLegacyModeHonorsDelay(t *testing.T) {
ts := newTunnelState(caddy.Log(), 40*time.Millisecond)
conn := newTrackingReadWriteCloser()
ts.registerConnection(conn, nil, "a")
ts.registerConnection(conn, nil, false, "a")
h := &Handler{
tunnel: ts,
@ -175,8 +175,8 @@ func TestHandlerCleanupRetainModeClosesOnlyRemovedUpstreams(t *testing.T) {
ts := newTunnelState(caddy.Log(), 0)
connA := newTrackingReadWriteCloser()
connB := newTrackingReadWriteCloser()
ts.registerConnection(connA, nil, upstreamA)
ts.registerConnection(connB, nil, upstreamB)
ts.registerConnection(connA, nil, true, upstreamA)
ts.registerConnection(connB, nil, true, upstreamB)
h := &Handler{
tunnel: ts,