From c28175c4f6c909c8eb4b38f75f62cb5353069865 Mon Sep 17 00:00:00 2001 From: Lucas Roesler Date: Sun, 23 Jun 2019 09:20:23 +0200 Subject: [PATCH] Fix missing imports and tests **What** - Fix missing imports since my ide forgot to add the "time" package - Update the tests to accept the handler timeout duration Signed-off-by: Lucas Roesler --- gateway/handlers/logs.go | 1 + gateway/handlers/logs_test.go | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gateway/handlers/logs.go b/gateway/handlers/logs.go index 0a883fc6..7b784efa 100644 --- a/gateway/handlers/logs.go +++ b/gateway/handlers/logs.go @@ -8,6 +8,7 @@ import ( "net/url" "os" "strings" + "time" ) const crlf = "\r\n" diff --git a/gateway/handlers/logs_test.go b/gateway/handlers/logs_test.go index 13bfd1a4..9c0f0ffd 100644 --- a/gateway/handlers/logs_test.go +++ b/gateway/handlers/logs_test.go @@ -8,6 +8,7 @@ import ( "net/http/httptest" "net/url" "testing" + "time" "go.uber.org/goleak" ) @@ -42,7 +43,7 @@ func Test_logsProxyDoesNotLeakGoroutinesWhenProviderClosesConnection(t *testing. logProviderURL, _ := url.Parse(mockLogsUpstreamEndpoint.URL) - logHandler := NewLogHandlerFunc(*logProviderURL) + logHandler := NewLogHandlerFunc(*logProviderURL, time.Minute) testSrv := httptest.NewServer(http.HandlerFunc(logHandler)) defer testSrv.Close() @@ -107,7 +108,7 @@ func Test_logsProxyDoesNotLeakGoroutinesWhenClientClosesConnection(t *testing.T) logProviderURL, _ := url.Parse(mockLogsUpstreamEndpoint.URL) - logHandler := NewLogHandlerFunc(*logProviderURL) + logHandler := NewLogHandlerFunc(*logProviderURL, time.Minute) testSrv := httptest.NewServer(http.HandlerFunc(logHandler)) defer testSrv.Close()