mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 14:26:27 +00:00
* Due to #44894 some constellations log a deprecation warning here now * Fixed by checking for that
This commit is contained in:
parent
79121ea127
commit
1340ff19bc
@ -48,13 +48,17 @@ public class ScalingThreadPoolTests extends ESThreadPoolTestCase {
|
|||||||
core = "generic".equals(threadPoolName) ? 4 : 1; // the defaults
|
core = "generic".equals(threadPoolName) ? 4 : 1; // the defaults
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final int availableProcessors = Runtime.getRuntime().availableProcessors();
|
||||||
final int maxBasedOnNumberOfProcessors;
|
final int maxBasedOnNumberOfProcessors;
|
||||||
|
final int processorsUsed;
|
||||||
if (randomBoolean()) {
|
if (randomBoolean()) {
|
||||||
final int processors = randomIntBetween(1, 64);
|
final int processors = randomIntBetween(1, 64);
|
||||||
maxBasedOnNumberOfProcessors = expectedSize(threadPoolName, processors);
|
maxBasedOnNumberOfProcessors = expectedSize(threadPoolName, processors);
|
||||||
builder.put("processors", processors);
|
builder.put("processors", processors);
|
||||||
|
processorsUsed = processors;
|
||||||
} else {
|
} else {
|
||||||
maxBasedOnNumberOfProcessors = expectedSize(threadPoolName, Runtime.getRuntime().availableProcessors());
|
maxBasedOnNumberOfProcessors = expectedSize(threadPoolName, availableProcessors);
|
||||||
|
processorsUsed = availableProcessors;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int expectedMax;
|
final int expectedMax;
|
||||||
@ -93,6 +97,11 @@ public class ScalingThreadPoolTests extends ESThreadPoolTestCase {
|
|||||||
assertThat(info.getMax(), equalTo(expectedMax));
|
assertThat(info.getMax(), equalTo(expectedMax));
|
||||||
assertThat(esThreadPoolExecutor.getMaximumPoolSize(), equalTo(expectedMax));
|
assertThat(esThreadPoolExecutor.getMaximumPoolSize(), equalTo(expectedMax));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (processorsUsed > availableProcessors) {
|
||||||
|
assertWarnings("setting processors to value [" + processorsUsed +
|
||||||
|
"] which is more than available processors [" + availableProcessors + "] is deprecated");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int expectedSize(final String threadPoolName, final int numberOfProcessors) {
|
private int expectedSize(final String threadPoolName, final int numberOfProcessors) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user