push_test.go: properly close the created httptest.Server after every test call

This commit is contained in:
Aliaksandr Valialkin 2023-12-18 12:35:00 +02:00
parent de719538d1
commit b96951708c
No known key found for this signature in database
GPG Key ID: 52C003EE2BCDB9EB

View File

@ -89,6 +89,7 @@ func TestInitPushWithOptions(t *testing.T) {
firstRequest = false
}
}))
defer srv.Close()
ctx, cancel := context.WithCancel(context.Background())
if err := s.InitPushWithOptions(ctx, srv.URL, time.Millisecond, opts); err != nil {
t.Fatalf("unexpected error: %s", err)