Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
georgew5656 committed Dec 13, 2024
1 parent 5ebd372 commit ed06f88
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,28 @@ public void testStopping()
verifyAll();
}

@Test
public void testStopGracefully() throws Exception
{
EasyMock.expect(spec.isSuspended()).andReturn(false).anyTimes();
EasyMock.expect(recordSupplier.getPartitionIds(STREAM)).andReturn(ImmutableSet.of(SHARD_ID)).anyTimes();
EasyMock.expect(taskStorage.getActiveTasksByDatasource(DATASOURCE)).andReturn(ImmutableList.of()).anyTimes();
EasyMock.expect(taskQueue.add(EasyMock.anyObject())).andReturn(true).anyTimes();

taskRunner.unregisterListener("testSupervisorId");
indexTaskClient.close();
recordSupplier.close();

replayAll();
SeekableStreamSupervisor supervisor = new TestSeekableStreamSupervisor();

supervisor.start();
supervisor.runInternal();
ListenableFuture<Void> stopFuture = supervisor.stopAsync(false);
stopFuture.get();
verifyAll();
}

@Test
public void testStoppingGracefully()
{
Expand Down

0 comments on commit ed06f88

Please sign in to comment.