Fix scaling thread pool test bug
This commit fixes a test bug in the scaling thread pool configuration test. In particular, the test randomization could select min and max for a thread pool configuration where both are equal to zero. This is a violation of the requirements of the ThreadPoolExecutor. With this commit, we now ensure that the max is bounded below by one.
This commit is contained in:
parent
80fee8666f
commit
140f9dfe5f
|
@ -59,7 +59,7 @@ public class ScalingThreadPoolTests extends ESThreadPoolTestCase {
|
|||
|
||||
final int expectedSize;
|
||||
if (sizeBasedOnNumberOfProcessors < min || randomBoolean()) {
|
||||
expectedSize = randomIntBetween(min, 16);
|
||||
expectedSize = randomIntBetween(Math.max(1, min), 16);
|
||||
builder.put("threadpool." + threadPoolName + ".size", expectedSize);
|
||||
} else {
|
||||
expectedSize = sizeBasedOnNumberOfProcessors;
|
||||
|
|
Loading…
Reference in New Issue