From ea8bde66363623838921636b943b74fcf4adfca0 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Wed, 28 Apr 2021 09:30:14 +0200 Subject: [PATCH] proxy: log error when port is used --- proxy/proxy_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proxy/proxy_test.go b/proxy/proxy_test.go index f8c3afa..5b7f54b 100644 --- a/proxy/proxy_test.go +++ b/proxy/proxy_test.go @@ -81,7 +81,11 @@ func TestProxyHTTP(t *testing.T) { Addr: testProxyAddr, Handler: http.HandlerFunc(p.ServeHTTP), } - go func() { _ = server.ListenAndServe() }() + go func() { + if err := server.ListenAndServe(); err != http.ErrServerClosed { + t.Errorf("Error serving on %s: %v", testProxyAddr, err) + } + }() defer closeOrFail(t, server) // Start the target backend service.