diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index 804f7cc32ccb2..d6710d7828c81 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -887,6 +887,12 @@ class BuildPlugin implements Plugin { // 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 diff --git a/modules/transport-netty4/build.gradle b/modules/transport-netty4/build.gradle index ff21cfa30d357..b390ab3af5829 100644 --- a/modules/transport-netty4/build.gradle +++ b/modules/transport-netty4/build.gradle @@ -51,9 +51,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 { @@ -62,9 +59,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' } thirdPartyAudit { diff --git a/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java index b911a963073d2..857c32426c641 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java @@ -242,9 +242,6 @@ private static void setTestSysProps() { // 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());