diff --git a/subscription_test.go b/subscription_test.go index c940285..509904d 100644 --- a/subscription_test.go +++ b/subscription_test.go @@ -385,7 +385,7 @@ func TestConnectToSSEFailure(t *testing.T) { config := configContainer{client: &clientCfg} endpoint := newFakeMarathonEndpoint(t, &config) - endpoint.Close() + endpoint.CloseServer() client := endpoint.Client.(*marathonClient) @@ -425,7 +425,7 @@ func TestRegisterSEESubscriptionReconnectsStreamOnError(t *testing.T) { time.Sleep(SSEConnectWaitTime) // This should make the SSE subscription fail and reconnect to another cluster member - endpoint1.Close() + endpoint1.CloseServer() // Give it a bit of time so that the subscription can reconnect time.Sleep(SSEConnectWaitTime) diff --git a/testing_utils_test.go b/testing_utils_test.go index a427f68..0822f41 100644 --- a/testing_utils_test.go +++ b/testing_utils_test.go @@ -319,5 +319,10 @@ func (s *fakeServer) Close() { } func (e *endpoint) Close() { + e.Client.Stop() + e.CloseServer() +} + +func (e *endpoint) CloseServer() { e.Server.Close() }