Skip to content

Commit e01eadf

Browse files
committed
fix test for async operations
1 parent 25913a4 commit e01eadf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

client-v2/src/test/java/com/clickhouse/client/insert/InsertTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import java.util.Collections;
5353
import java.util.List;
5454
import java.util.UUID;
55+
import java.util.concurrent.Executors;
5556
import java.util.concurrent.TimeUnit;
5657
import java.util.zip.GZIPOutputStream;
5758

@@ -104,7 +105,8 @@ protected Client.Builder newClient() {
104105
.useHttpCompression(useHttpCompression)
105106
.setDefaultDatabase(ClickHouseServerForTest.getDatabase())
106107
.serverSetting(ServerSettings.ASYNC_INSERT, "0")
107-
.serverSetting(ServerSettings.WAIT_END_OF_QUERY, "1");
108+
.serverSetting(ServerSettings.WAIT_END_OF_QUERY, "1")
109+
.setSharedOperationExecutor(Executors.newCachedThreadPool());
108110
}
109111

110112
@AfterMethod(groups = { "integration" })
@@ -287,7 +289,7 @@ public void insertRawDataAsync(boolean async) throws Exception {
287289
List<GenericRecord> records = client.queryAll("SELECT * FROM " + tableName);
288290
assertEquals(records.size(), 1000);
289291
assertTrue(Thread.currentThread().getName()
290-
.startsWith(async ? "ForkJoinPool.commonPool" : "main"), "Threads starts with " + Thread.currentThread().getName());
292+
.startsWith(async ? "pool-1-thread-" : "main"), "Threads starts with " + Thread.currentThread().getName());
291293
})
292294
.join(); // wait operation complete. only for tests
293295
}

0 commit comments

Comments
 (0)