diff --git a/modules/reindex/build.gradle b/modules/reindex/build.gradle index 960b310af6946..227c12616ac6f 100644 --- a/modules/reindex/build.gradle +++ b/modules/reindex/build.gradle @@ -32,15 +32,6 @@ testClusters.all { setting 'reindex.remote.whitelist', '127.0.0.1:*' } -tasks.named("test").configure { - /* - * We have to disable setting the number of available processors as tests in the - * same JVM randomize processors and will step on each 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' -} - dependencies { api project(":client:rest") api project(":libs:elasticsearch-ssl-config") diff --git a/modules/transport-netty4/build.gradle b/modules/transport-netty4/build.gradle index b651a7da9cb13..57a96bdfdf431 100644 --- a/modules/transport-netty4/build.gradle +++ b/modules/transport-netty4/build.gradle @@ -49,31 +49,13 @@ tasks.named("dependencyLicenses").configure { mapping from: /netty-.*/, to: 'netty' } -tasks.named("test").configure { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * 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' -} - -tasks.named("internalClusterTest").configure { - systemProperty 'es.set.netty.runtime.available.processors', 'false' -} - -tasks.named("javaRestTest").configure { - systemProperty 'es.set.netty.runtime.available.processors', 'false' -} - TaskProvider pooledTest = tasks.register("pooledTest", Test) { include '**/*Tests.class' - systemProperty 'es.set.netty.runtime.available.processors', 'false' systemProperty 'es.use_unpooled_allocator', 'false' } TaskProvider pooledInternalClusterTest = tasks.register("pooledInternalClusterTest", Test) { include '**/*IT.class' - systemProperty 'es.set.netty.runtime.available.processors', 'false' systemProperty 'es.use_unpooled_allocator', 'false' SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); SourceSet internalTestSourceSet = sourceSets.getByName(InternalClusterTestPlugin.SOURCE_SET_NAME) @@ -82,7 +64,6 @@ TaskProvider pooledInternalClusterTest = tasks.register("pooledInternalClu } TaskProvider pooledJavaRestTest = tasks.register("pooledJavaRestTest", RestIntegTestTask) { - systemProperty 'es.set.netty.runtime.available.processors', 'false' SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); SourceSet javaRestTestSourceSet = sourceSets.getByName(JavaRestTestPlugin.SOURCE_SET_NAME) setTestClassesDirs(javaRestTestSourceSet.getOutput().getClassesDirs()) diff --git a/qa/smoke-test-http/build.gradle b/qa/smoke-test-http/build.gradle index f08700b9c24d6..b0acfcb0f9a46 100644 --- a/qa/smoke-test-http/build.gradle +++ b/qa/smoke-test-http/build.gradle @@ -20,11 +20,3 @@ dependencies { testClusters.all { setting 'xpack.security.enabled', 'false' } - -tasks.named("integTest").configure { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * 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' -} 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 667bff840c617..64003d0d7eee7 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java @@ -248,6 +248,10 @@ private static void setTestSysProps() { // Enable Netty leak detection and monitor logger for logged leak errors System.setProperty("io.netty.leakDetection.level", "paranoid"); + + // We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each + // other if we allow them to set the number of available processors as it's set-once in Netty. + System.setProperty("es.set.netty.runtime.available.processors", "false"); } protected final Logger logger = LogManager.getLogger(getClass()); diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 33409d5d1b6e7..04862bd4d55a6 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -85,11 +85,6 @@ tasks.withType(RestIntegTestTask).configureEach { } tasks.named("yamlRestTest").configure { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * 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' systemProperty 'tests.rest.blacklist', restTestBlacklist.join(',') dependsOn "copyExtraResources" } @@ -156,12 +151,6 @@ def v7compatibilityNotSupportedTests = { } tasks.named("yamlRestCompatTest").configure { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * 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' - systemProperty 'tests.rest.blacklist', v7compatibilityNotSupportedTests().join(',') dependsOn "copyExtraResources" } diff --git a/x-pack/plugin/core/build.gradle b/x-pack/plugin/core/build.gradle index 563f91b415fbb..7fa68592750e5 100644 --- a/x-pack/plugin/core/build.gradle +++ b/x-pack/plugin/core/build.gradle @@ -111,14 +111,6 @@ sourceSets.test.resources { srcDir 'src/main/config' } -tasks.named("test").configure { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * 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' -} - tasks.named("thirdPartyAudit").configure { ignoreMissingClasses( //commons-logging optional dependencies diff --git a/x-pack/plugin/data-streams/build.gradle b/x-pack/plugin/data-streams/build.gradle index 06dc0b9cdcae5..b1ceab4f4bdea 100644 --- a/x-pack/plugin/data-streams/build.gradle +++ b/x-pack/plugin/data-streams/build.gradle @@ -16,11 +16,3 @@ dependencies { } addQaCheckDependencies() - -tasks.named("internalClusterTest").configure { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * 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' -} diff --git a/x-pack/plugin/identity-provider/build.gradle b/x-pack/plugin/identity-provider/build.gradle index 5fa5b9eafa4a8..d7bd26163c0ca 100644 --- a/x-pack/plugin/identity-provider/build.gradle +++ b/x-pack/plugin/identity-provider/build.gradle @@ -341,18 +341,6 @@ tasks.named("thirdPartyAudit").configure { ) } -tasks.named("test").configure { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * 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' -} - -tasks.named("internalClusterTest").configure { - systemProperty 'es.set.netty.runtime.available.processors', 'false' -} - addQaCheckDependencies() if (BuildParams.inFipsJvm) { diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle index 4a2fd3176eb6f..08dcb1c17d42c 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle @@ -26,11 +26,6 @@ tasks.named("processJavaRestTestResources").configure { dependsOn("copyKeyCerts" tasks.named("javaRestTest").configure { dependsOn "copyKeyCerts" - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * 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' } testClusters.all { diff --git a/x-pack/plugin/security/build.gradle b/x-pack/plugin/security/build.gradle index 7f23ab4e82548..60cf4aeb9e6f7 100644 --- a/x-pack/plugin/security/build.gradle +++ b/x-pack/plugin/security/build.gradle @@ -462,21 +462,7 @@ tasks.named("thirdPartyAudit").configure { ) } -tasks.named("test").configure { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * 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' -} - tasks.named("internalClusterTest").configure { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * 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' - /* * Some tests in this module set up a lot of transport threads so we reduce the buffer size per transport thread from the 1M default * to keep direct memory usage under control. diff --git a/x-pack/plugin/watcher/build.gradle b/x-pack/plugin/watcher/build.gradle index 4a22191638d39..165d7497c213f 100644 --- a/x-pack/plugin/watcher/build.gradle +++ b/x-pack/plugin/watcher/build.gradle @@ -78,12 +78,4 @@ tasks.named("forbiddenPatterns").configure { exclude '**/*.p12' } -tasks.named("internalClusterTest").configure { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * 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' -} - addQaCheckDependencies() diff --git a/x-pack/qa/third-party/active-directory/build.gradle b/x-pack/qa/third-party/active-directory/build.gradle index bb63be7a90c28..7f6f5d832d89d 100644 --- a/x-pack/qa/third-party/active-directory/build.gradle +++ b/x-pack/qa/third-party/active-directory/build.gradle @@ -22,11 +22,6 @@ tasks.named("forbiddenPatterns").configure { } tasks.named("test").configure { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * 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' include '**/*IT.class' include '**/*Tests.class' }