Set netty system properties in BuildPlugin (#45881)

Currently in production instances of Elasticsearch we set a couple of
system properties by default. We currently do not apply all of these
system properties in tests. This commit applies these properties in the
tests.
This commit is contained in:
Tim Brooks 2019-08-29 17:38:37 -06:00
parent ffae769186
commit 6720c56bdd
No known key found for this signature in database
GPG Key ID: C2AA3BB91A889E77
3 changed files with 6 additions and 9 deletions

View File

@ -901,6 +901,12 @@ class BuildPlugin implements Plugin<Project> {
// TODO: remove this once cname is prepended to transport.publish_address by default in 8.0
test.systemProperty 'es.transport.cname_in_publish_address', 'true'
// Set netty system properties to the properties we configure in jvm.options
test.systemProperty('io.netty.noUnsafe', 'true')
test.systemProperty('io.netty.noKeySetOptimization', 'true')
test.systemProperty('io.netty.recycler.maxCapacityPerThread', '0')
test.systemProperty('io.netty.allocator.numDirectArenas', '0')
test.testLogging { TestLoggingContainer logging ->
logging.showExceptions = true
logging.showCauses = true

View File

@ -54,9 +54,6 @@ test {
* other if we allow them to set the number of available processors as it's set-once in Netty.
*/
systemProperty 'es.set.netty.runtime.available.processors', 'false'
// Disable direct buffer pooling as it is disabled by default in Elasticsearch
systemProperty 'io.netty.allocator.numDirectArenas', '0'
}
integTestRunner {
@ -65,9 +62,6 @@ integTestRunner {
* other if we allow them to set the number of available processors as it's set-once in Netty.
*/
systemProperty 'es.set.netty.runtime.available.processors', 'false'
// Disable direct buffer pooling as it is disabled by default in Elasticsearch
systemProperty 'io.netty.allocator.numDirectArenas', '0'
}
TaskProvider<Test> pooledTest = tasks.register("pooledTest", Test) {

View File

@ -243,9 +243,6 @@ public abstract class ESTestCase extends LuceneTestCase {
// Enable Netty leak detection and monitor logger for logged leak errors
System.setProperty("io.netty.leakDetection.level", "paranoid");
// Disable direct buffer pooling
System.setProperty("io.netty.allocator.numDirectArenas", "0");
}
protected final Logger logger = LogManager.getLogger(getClass());