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 <roesler.lucas@gmail.com>
This commit is contained in:
Lucas Roesler
2019-06-23 09:20:23 +02:00
committed by Alex Ellis
parent 6df51a3516
commit c28175c4f6
2 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,7 @@ import (
"net/url"
"os"
"strings"
"time"
)
const crlf = "\r\n"

View File

@ -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()