From 02fb75e59e9c23f44917505ba1ed8442346e4692 Mon Sep 17 00:00:00 2001 From: Anderson Queiroz Date: Thu, 31 Oct 2024 14:14:03 +0100 Subject: [PATCH] proxytest: fix log after test finished (#5878) --- testing/proxytest/proxytest_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/testing/proxytest/proxytest_test.go b/testing/proxytest/proxytest_test.go index c768e875083..f367ced2b62 100644 --- a/testing/proxytest/proxytest_test.go +++ b/testing/proxytest/proxytest_test.go @@ -233,8 +233,10 @@ func TestProxy(t *testing.T) { func TestHTTPSProxy(t *testing.T) { targetHost := "not-a-server.co" proxy, client, target := prepareMTLSProxyAndTargetServer(t, targetHost) - defer proxy.Close() - defer target.Close() + t.Cleanup(func() { + proxy.Close() + target.Close() + }) tcs := []struct { name string