Skip to content

Commit 76a0fe8

Browse files
committed
Extend fakeServer to stop the Marathon client by default.
Add extra CloseServer method for cases where only the server should be closed.
1 parent c9a4f30 commit 76a0fe8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

subscription_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ func TestConnectToSSEFailure(t *testing.T) {
385385
config := configContainer{client: &clientCfg}
386386

387387
endpoint := newFakeMarathonEndpoint(t, &config)
388-
endpoint.Close()
388+
endpoint.CloseServer()
389389

390390
client := endpoint.Client.(*marathonClient)
391391

@@ -425,7 +425,7 @@ func TestRegisterSEESubscriptionReconnectsStreamOnError(t *testing.T) {
425425
time.Sleep(SSEConnectWaitTime)
426426

427427
// This should make the SSE subscription fail and reconnect to another cluster member
428-
endpoint1.Close()
428+
endpoint1.CloseServer()
429429

430430
// Give it a bit of time so that the subscription can reconnect
431431
time.Sleep(SSEConnectWaitTime)

testing_utils_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,5 +319,10 @@ func (s *fakeServer) Close() {
319319
}
320320

321321
func (e *endpoint) Close() {
322+
e.Client.Stop()
323+
e.CloseServer()
324+
}
325+
326+
func (e *endpoint) CloseServer() {
322327
e.Server.Close()
323328
}

0 commit comments

Comments
 (0)