From a078bb4b92cc13f96a329b7cf094237596445ed1 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Fri, 30 Aug 2019 11:37:18 -0700 Subject: [PATCH] Add test tasks for unpooled and direct buffer pooling to netty (#46049) Some netty behavior is controlled by system properties. While we want to test with the defaults for Elasticsearch for most tests, within netty we want to ensure these netty settings exhibit correct behavior. This commit adds variants of test and integTest tasks for netty which set the unpooled and direct buffer pooled allocators. relates #45881 --- modules/transport-netty4/build.gradle | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/transport-netty4/build.gradle b/modules/transport-netty4/build.gradle index e7fcec40675..61a54fef8f4 100644 --- a/modules/transport-netty4/build.gradle +++ b/modules/transport-netty4/build.gradle @@ -17,6 +17,8 @@ * under the License. */ +import org.elasticsearch.gradle.test.RestIntegTestTask + /* TODOs: * fix permissions such that only netty4 can open sockets etc? @@ -68,6 +70,22 @@ integTestRunner { systemProperty 'io.netty.allocator.numDirectArenas', '0' } +TaskProvider pooledTest = tasks.register("pooledTest", Test) { + include '**/*Tests.class' + systemProperty 'es.set.netty.runtime.available.processors', 'false' + systemProperty 'io.netty.allocator.type', 'pooled' +} +// TODO: we can't use task avoidance here because RestIntegTestTask does the testcluster creation +RestIntegTestTask pooledIntegTest = tasks.create("pooledIntegTest", RestIntegTestTask) { + runner { + systemProperty 'es.set.netty.runtime.available.processors', 'false' + } +} +testClusters.pooledIntegTest { + systemProperty 'io.netty.allocator.type', 'pooled' +} +check.dependsOn(pooledTest, pooledIntegTest) + thirdPartyAudit { ignoreMissingClasses ( // classes are missing