Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set netty available processors system property for tests globally #75699

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

configuring this here probably didn't even make sense (as it's a YML test), right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. I suspect it was just copy/pasted from elsewhere.

systemProperty 'tests.rest.blacklist', restTestBlacklist.join(',')
dependsOn "copyExtraResources"
}
Expand Down Expand Up @@ -143,12 +138,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'

//TODO: blacklist specific to REST API compatibility
restTestBlacklist.addAll([
'license/30_enterprise_license/Installing enterprise license',
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'
}