extra debug on test failure

Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
Greg Wilkins 2018-03-06 18:59:56 +11:00
parent 2905d081b4
commit 9f2e4fd1f4
2 changed files with 9 additions and 2 deletions

View File

@ -97,7 +97,7 @@ public class ThreadPoolBudget
*/
public ThreadPoolBudget(ThreadPool.SizedThreadPool pool)
{
this(pool,Runtime.getRuntime().availableProcessors());
this(pool,Math.min(Runtime.getRuntime().availableProcessors(),pool.getMinThreads()));
}
/**

View File

@ -36,6 +36,7 @@ import org.eclipse.jetty.util.thread.ExecutionStrategy;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.eclipse.jetty.util.thread.ExecutionStrategy.Producer;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -72,6 +73,7 @@ public class ExecutionStrategyTest
@Before
public void before() throws Exception
{
_threads.setDetailedDump(true);
_threads.start();
}
@ -213,6 +215,11 @@ public class ExecutionStrategyTest
}
});
assertTrue(latch.await(30,TimeUnit.SECONDS));
if (!latch.await(30,TimeUnit.SECONDS))
{
System.err.println(_strategy);
_threads.dumpStdErr();
Assert.fail();
}
}
}