diff --git a/logtail/logtail_test.go b/logtail/logtail_test.go index 5e3083cc3..576cc1888 100644 --- a/logtail/logtail_test.go +++ b/logtail/logtail_test.go @@ -16,8 +16,12 @@ func TestFastShutdown(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) cancel() + testServ := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) {})) + defer testServ.Close() + l := NewLogger(Config{ - BaseURL: "http://localhost:1234", + BaseURL: testServ.URL, }, t.Logf) l.Shutdown(ctx) } @@ -30,6 +34,7 @@ func TestUploadMessages(t *testing.T) { w.Header().Set("Content-Type", "application/json; charset=utf-8") uploads += 1 })) + defer testServ.Close() l := NewLogger(Config{BaseURL: testServ.URL}, t.Logf) for i := 1; i < 10; i++ {