diff --git a/server/src/test/java/org/elasticsearch/common/util/concurrent/QueueResizingEsThreadPoolExecutorTests.java b/server/src/test/java/org/elasticsearch/common/util/concurrent/QueueResizingEsThreadPoolExecutorTests.java index eadcbf93e4a33..1d5fcbd0a80c6 100644 --- a/server/src/test/java/org/elasticsearch/common/util/concurrent/QueueResizingEsThreadPoolExecutorTests.java +++ b/server/src/test/java/org/elasticsearch/common/util/concurrent/QueueResizingEsThreadPoolExecutorTests.java @@ -110,64 +110,6 @@ public void testAutoQueueSizingDown() throws Exception { executor.awaitTermination(10, TimeUnit.SECONDS); } - public void testAutoQueueSizingWithMin() throws Exception { - ThreadContext context = new ThreadContext(Settings.EMPTY); - ResizableBlockingQueue queue = - new ResizableBlockingQueue<>(ConcurrentCollections.newBlockingQueue(), - 5000); - - int threads = randomIntBetween(1, 5); - int measureWindow = randomIntBetween(10, 100); - int min = randomIntBetween(4981, 4999); - logger.info("--> auto-queue with a measurement window of {} tasks", measureWindow); - QueueResizingEsThreadPoolExecutor executor = - new QueueResizingEsThreadPoolExecutor( - "test-threadpool", threads, threads, 1000, - TimeUnit.MILLISECONDS, queue, min, 100000, slowWrapper(), measureWindow, TimeValue.timeValueMillis(1), - EsExecutors.daemonThreadFactory("queuetest"), new EsAbortPolicy(), context); - executor.prestartAllCoreThreads(); - logger.info("--> executor: {}", executor); - - // Execute a task multiple times that takes 1m - executeTask(executor, (measureWindow * 5)); - - // The queue capacity should decrease, but no lower than the minimum - assertBusy(() -> { - assertThat(queue.capacity(), equalTo(min)); - }); - executor.shutdown(); - executor.awaitTermination(10, TimeUnit.SECONDS); - } - - public void testAutoQueueSizingWithMax() throws Exception { - ThreadContext context = new ThreadContext(Settings.EMPTY); - ResizableBlockingQueue queue = - new ResizableBlockingQueue<>(ConcurrentCollections.newBlockingQueue(), - 5000); - - int threads = randomIntBetween(1, 5); - int measureWindow = randomIntBetween(10, 100); - int max = randomIntBetween(5010, 5024); - logger.info("--> auto-queue with a measurement window of {} tasks", measureWindow); - QueueResizingEsThreadPoolExecutor executor = - new QueueResizingEsThreadPoolExecutor( - "test-threadpool", threads, threads, 1000, - TimeUnit.MILLISECONDS, queue, 10, max, fastWrapper(), measureWindow, TimeValue.timeValueMillis(1), - EsExecutors.daemonThreadFactory("queuetest"), new EsAbortPolicy(), context); - executor.prestartAllCoreThreads(); - logger.info("--> executor: {}", executor); - - // Execute a task multiple times that takes 1ms - executeTask(executor, measureWindow * 3); - - // The queue capacity should increase, but no higher than the maximum - assertBusy(() -> { - assertThat(queue.capacity(), equalTo(max)); - }); - executor.shutdown(); - executor.awaitTermination(10, TimeUnit.SECONDS); - } - public void testExecutionEWMACalculation() throws Exception { ThreadContext context = new ThreadContext(Settings.EMPTY); ResizableBlockingQueue queue =