Skip to content

Commit

Permalink
[SDKS-7446] Remove stop SSE from destroy when SDK is in polling mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nmayorsplit committed Sep 5, 2023
1 parent d439f75 commit 19ca58a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ public void shutdown() throws IOException {
_shuttedDown.set(true);
_initializationtExecutorService.shutdownNow();
_synchronizer.stopPeriodicFetching();
_pushManager.stop();
_pushMonitorExecutorService.shutdownNow();
if (_streamingEnabledConfig.get()) {
_pushManager.stop();
_pushMonitorExecutorService.shutdownNow();
}
_segmentSynchronizationTaskImp.close();
_log.info("Successful shutdown of segment fetchers");
_splitSynchronizationTask.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public void startWithStreamingFalseShouldStartPolling() throws InterruptedExcept
Mockito.verify(_pushManager, Mockito.times(0)).start();

syncManager.shutdown();
Mockito.verify(_pushManager, Mockito.times(0)).stop();
Mockito.verify(_synchronizer, Mockito.times(1)).stopPeriodicDataRecording();
}

Expand All @@ -86,7 +87,7 @@ public void startWithStreamingTrueShouldStartSyncAll() throws InterruptedExcepti
}

@Test
public void onStreamingAvailable() throws InterruptedException, IOException {
public void onStreamingAvailable() throws InterruptedException {
TelemetryStorage telemetryStorage = Mockito.mock(TelemetryStorage.class);
LinkedBlockingQueue<PushManager.Status> messages = new LinkedBlockingQueue<>();
SplitTasks splitTasks = SplitTasks.build(_splitSynchronizationTask, _segmentSynchronizationTaskImp,
Expand All @@ -107,7 +108,7 @@ public void onStreamingAvailable() throws InterruptedException, IOException {
}

@Test
public void onStreamingDisabled() throws InterruptedException, IOException {
public void onStreamingDisabled() throws InterruptedException {
TelemetryStorage telemetryStorage = new InMemoryTelemetryStorage();
LinkedBlockingQueue<PushManager.Status> messsages = new LinkedBlockingQueue<>();
SplitTasks splitTasks = SplitTasks.build(_splitSynchronizationTask, _segmentSynchronizationTaskImp,
Expand All @@ -127,7 +128,7 @@ public void onStreamingDisabled() throws InterruptedException, IOException {
}

@Test
public void onStreamingShutdown() throws InterruptedException, IOException {
public void onStreamingShutdown() throws InterruptedException {
TelemetryStorage telemetryStorage = new InMemoryTelemetryStorage();
LinkedBlockingQueue<PushManager.Status> messsages = new LinkedBlockingQueue<>();
SplitTasks splitTasks = SplitTasks.build(_splitSynchronizationTask, _segmentSynchronizationTaskImp,
Expand Down Expand Up @@ -229,4 +230,4 @@ public void syncAllRetryThenShouldStartPolling() throws InterruptedException, IO
syncManager.shutdown();
Mockito.verify(_synchronizer, Mockito.times(1)).stopPeriodicDataRecording();
}
}
}

0 comments on commit 19ca58a

Please sign in to comment.