Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky unit tests in Rds source #5323

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading