Skip to content

Commit

Permalink
[test] [flink] Fix unstable test: AppendOnlySingleTableCompactionWork…
Browse files Browse the repository at this point in the history
…erOperator should be closed (apache#5009)
  • Loading branch information
leaves12138 authored Feb 5, 2025
1 parent aab1097 commit 1957230
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.apache.flink.streaming.util.MockOutput;
import org.apache.flink.streaming.util.MockStreamConfig;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;
Expand All @@ -51,7 +52,7 @@
/** Tests for {@link AppendOnlySingleTableCompactionWorkerOperator}. */
public class AppendOnlySingleTableCompactionWorkerOperatorTest extends TableTestBase {

@Test
@RepeatedTest(100)
public void testAsyncCompactionWorks() throws Exception {
createTableDefault();
AppendOnlySingleTableCompactionWorkerOperator workerOperator =
Expand Down Expand Up @@ -111,6 +112,11 @@ public void testAsyncCompactionWorks() throws Exception {
.size()
== 1)
.isTrue());
// need to close the operator to release the thread pool and close all files.
workerOperator.close();

// wait the last runnable in thread pool to stop
Thread.sleep(2_000);
}

@Test
Expand Down

0 comments on commit 1957230

Please sign in to comment.