Skip to content

Commit

Permalink
Set netty available processors system property for tests globally (el…
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira authored and ywangd committed Jul 30, 2021
1 parent 026a7ef commit 5be6f6d
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 107 deletions.
9 changes: 0 additions & 9 deletions modules/reindex/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
19 changes: 0 additions & 19 deletions modules/transport-netty4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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<Test> pooledTest = tasks.register("pooledTest", Test) {
include '**/*Tests.class'
systemProperty 'es.set.netty.runtime.available.processors', 'false'
systemProperty 'es.use_unpooled_allocator', 'false'
}

TaskProvider<Test> 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)
Expand All @@ -82,7 +64,6 @@ TaskProvider<Test> pooledInternalClusterTest = tasks.register("pooledInternalClu
}

TaskProvider<RestIntegTestTask> 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())
Expand Down
8 changes: 0 additions & 8 deletions qa/smoke-test-http/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
11 changes: 0 additions & 11 deletions x-pack/plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down Expand Up @@ -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"
}
Expand Down
8 changes: 0 additions & 8 deletions x-pack/plugin/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions x-pack/plugin/data-streams/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
12 changes: 0 additions & 12 deletions x-pack/plugin/identity-provider/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 0 additions & 5 deletions x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 0 additions & 14 deletions x-pack/plugin/security/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 0 additions & 8 deletions x-pack/plugin/watcher/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
5 changes: 0 additions & 5 deletions x-pack/qa/third-party/active-directory/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

0 comments on commit 5be6f6d

Please sign in to comment.