Skip to content

Commit

Permalink
Add sleep time before checking (#5323)
Browse files Browse the repository at this point in the history
Signed-off-by: Hai Yan <[email protected]>
  • Loading branch information
oeyh authored Jan 15, 2025
1 parent 5f51c2b commit c398e55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,13 @@ void test_data_file_loader_throws_exception_then_give_up_partition() {
}

@Test
void test_shutdown() {
void test_shutdown() throws InterruptedException {
DataFileScheduler objectUnderTest = createObjectUnderTest();
final ExecutorService executorService = Executors.newSingleThreadExecutor();
executorService.submit(objectUnderTest);

objectUnderTest.shutdown();
Thread.sleep(100);

verifyNoMoreInteractions(sourceCoordinator);
executorService.shutdownNow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,13 @@ void test_given_export_partition_and_null_export_task_id_then_close_partition_wi
}

@Test
void test_shutDown() {
void test_shutDown() throws InterruptedException {
lenient().when(sourceCoordinator.acquireAvailablePartition(ExportPartition.PARTITION_TYPE)).thenReturn(Optional.empty());

final ExecutorService executorService = Executors.newSingleThreadExecutor();
executorService.submit(exportScheduler);
exportScheduler.shutdown();
Thread.sleep(100);
verifyNoMoreInteractions(sourceCoordinator, snapshotManager, exportTaskManager, s3Client,
exportJobSuccessCounter, exportJobFailureCounter, exportS3ObjectsTotalCounter);
executorService.shutdownNow();
Expand Down

0 comments on commit c398e55

Please sign in to comment.