File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
server/src/test/java/org/elasticsearch/threadpool Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -310,4 +310,21 @@ public String toString() {
310
310
assertTrue (terminate (threadPool ));
311
311
}
312
312
}
313
+
314
+ public void testForceMergeThreadPoolSize () {
315
+ final int allocatedProcessors = randomIntBetween (1 , EsExecutors .allocatedProcessors (Settings .EMPTY ));
316
+ final ThreadPool threadPool = new TestThreadPool (
317
+ "test" ,
318
+ Settings .builder ().put (EsExecutors .NODE_PROCESSORS_SETTING .getKey (), allocatedProcessors ).build ()
319
+ );
320
+ try {
321
+ final int expectedSize = Math .max (1 , allocatedProcessors / 8 );
322
+ ThreadPool .Info info = threadPool .info (ThreadPool .Names .FORCE_MERGE );
323
+ assertThat (info .getThreadPoolType (), equalTo (ThreadPool .ThreadPoolType .FIXED ));
324
+ assertThat (info .getMin (), equalTo (expectedSize ));
325
+ assertThat (info .getMax (), equalTo (expectedSize ));
326
+ } finally {
327
+ assertTrue (terminate (threadPool ));
328
+ }
329
+ }
313
330
}
You can’t perform that action at this time.
0 commit comments