summaryrefslogtreecommitdiffstats
path: root/container-core/src/test/java/com/yahoo/container/handler
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2020-09-07 15:06:24 +0200
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2020-09-07 17:53:16 +0200
commitab8b4e97ccea563b3e481e59a689f1f9d5b2386f (patch)
tree47e878e46c90b08b7073ed6b888dfbcd9e5b2bcf /container-core/src/test/java/com/yahoo/container/handler
parent4c5492d00a012b833fe24decb72c5c54f690fd79 (diff)
Use separate non-public config definition for ContainerThreadPool
Diffstat (limited to 'container-core/src/test/java/com/yahoo/container/handler')
-rw-r--r--container-core/src/test/java/com/yahoo/container/handler/threadpool/ContainerThreadPoolTest.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/container-core/src/test/java/com/yahoo/container/handler/threadpool/ContainerThreadPoolTest.java b/container-core/src/test/java/com/yahoo/container/handler/threadpool/ContainerThreadPoolTest.java
index f6a3aebd7ff..02e791099ed 100644
--- a/container-core/src/test/java/com/yahoo/container/handler/threadpool/ContainerThreadPoolTest.java
+++ b/container-core/src/test/java/com/yahoo/container/handler/threadpool/ContainerThreadPoolTest.java
@@ -3,7 +3,6 @@ package com.yahoo.container.handler.threadpool;
import com.yahoo.collections.Tuple2;
import com.yahoo.concurrent.Receiver;
-import com.yahoo.container.handler.ThreadpoolConfig;
import com.yahoo.container.protect.ProcessTerminator;
import com.yahoo.jdisc.Metric;
import org.junit.Ignore;
@@ -24,7 +23,7 @@ import static org.junit.Assert.fail;
public class ContainerThreadPoolTest {
@Test
public final void testThreadPool() throws InterruptedException {
- ThreadpoolConfig config = new ThreadpoolConfig(new ThreadpoolConfig.Builder().maxthreads(1));
+ ContainerThreadpoolConfig config = new ContainerThreadpoolConfig(new ContainerThreadpoolConfig.Builder().maxThreads(1));
ContainerThreadPool threadPool = new ContainerThreadPool(config, Mockito.mock(Metric.class));
Executor exec = threadPool.executor();
Tuple2<Receiver.MessageState, Boolean> reply;
@@ -56,7 +55,7 @@ public class ContainerThreadPoolTest {
}
private ThreadPoolExecutor createPool(int maxThreads, int queueSize) {
- ThreadpoolConfig config = new ThreadpoolConfig(new ThreadpoolConfig.Builder().maxthreads(maxThreads).queueSize(queueSize));
+ ContainerThreadpoolConfig config = new ContainerThreadpoolConfig(new ContainerThreadpoolConfig.Builder().maxThreads(maxThreads).queueSize(queueSize));
ContainerThreadPool threadPool = new ContainerThreadPool(config, Mockito.mock(Metric.class));
ExecutorServiceWrapper wrapper = (ExecutorServiceWrapper) threadPool.executor();
WorkerCompletionTimingThreadPoolExecutor executor = (WorkerCompletionTimingThreadPoolExecutor)wrapper.delegate();
@@ -100,8 +99,10 @@ public class ContainerThreadPoolTest {
@Test
@Ignore // Ignored because it depends on the system time and so is unstable on factory
public void testThreadPoolTerminationOnBreakdown() throws InterruptedException {
- ThreadpoolConfig config = new ThreadpoolConfig(new ThreadpoolConfig.Builder().maxthreads(2)
- .maxThreadExecutionTimeSeconds(1));
+ ContainerThreadpoolConfig config = new ContainerThreadpoolConfig(
+ new ContainerThreadpoolConfig.Builder()
+ .maxThreads(2)
+ .maxThreadExecutionTimeSeconds(1));
MockProcessTerminator terminator = new MockProcessTerminator();
ContainerThreadPool threadPool = new ContainerThreadPool(config, Mockito.mock(Metric.class), terminator);