Skip to content

Commit 9d14bc9

Browse files
authored
Set netty available processors system property for tests globally (#75699)
1 parent eaeb772 commit 9d14bc9

File tree

12 files changed

+4
-107
lines changed

12 files changed

+4
-107
lines changed

modules/reindex/build.gradle

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,6 @@ testClusters.all {
3232
setting 'reindex.remote.whitelist', '127.0.0.1:*'
3333
}
3434

35-
tasks.named("test").configure {
36-
/*
37-
* We have to disable setting the number of available processors as tests in the
38-
* same JVM randomize processors and will step on each other if we allow them to
39-
* set the number of available processors as it's set-once in Netty.
40-
*/
41-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
42-
}
43-
4435
dependencies {
4536
api project(":client:rest")
4637
api project(":libs:elasticsearch-ssl-config")

modules/transport-netty4/build.gradle

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,31 +49,13 @@ tasks.named("dependencyLicenses").configure {
4949
mapping from: /netty-.*/, to: 'netty'
5050
}
5151

52-
tasks.named("test").configure {
53-
/*
54-
* We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each
55-
* other if we allow them to set the number of available processors as it's set-once in Netty.
56-
*/
57-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
58-
}
59-
60-
tasks.named("internalClusterTest").configure {
61-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
62-
}
63-
64-
tasks.named("javaRestTest").configure {
65-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
66-
}
67-
6852
TaskProvider<Test> pooledTest = tasks.register("pooledTest", Test) {
6953
include '**/*Tests.class'
70-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
7154
systemProperty 'es.use_unpooled_allocator', 'false'
7255
}
7356

7457
TaskProvider<Test> pooledInternalClusterTest = tasks.register("pooledInternalClusterTest", Test) {
7558
include '**/*IT.class'
76-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
7759
systemProperty 'es.use_unpooled_allocator', 'false'
7860
SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class);
7961
SourceSet internalTestSourceSet = sourceSets.getByName(InternalClusterTestPlugin.SOURCE_SET_NAME)
@@ -82,7 +64,6 @@ TaskProvider<Test> pooledInternalClusterTest = tasks.register("pooledInternalClu
8264
}
8365

8466
TaskProvider<RestIntegTestTask> pooledJavaRestTest = tasks.register("pooledJavaRestTest", RestIntegTestTask) {
85-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
8667
SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class);
8768
SourceSet javaRestTestSourceSet = sourceSets.getByName(JavaRestTestPlugin.SOURCE_SET_NAME)
8869
setTestClassesDirs(javaRestTestSourceSet.getOutput().getClassesDirs())

qa/smoke-test-http/build.gradle

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,3 @@ dependencies {
2020
testClusters.all {
2121
setting 'xpack.security.enabled', 'false'
2222
}
23-
24-
tasks.named("integTest").configure {
25-
/*
26-
* We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each
27-
* other if we allow them to set the number of available processors as it's set-once in Netty.
28-
*/
29-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
30-
}

test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ private static void setTestSysProps() {
248248

249249
// Enable Netty leak detection and monitor logger for logged leak errors
250250
System.setProperty("io.netty.leakDetection.level", "paranoid");
251+
252+
// We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each
253+
// other if we allow them to set the number of available processors as it's set-once in Netty.
254+
System.setProperty("es.set.netty.runtime.available.processors", "false");
251255
}
252256

253257
protected final Logger logger = LogManager.getLogger(getClass());

x-pack/plugin/build.gradle

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ tasks.withType(RestIntegTestTask).configureEach {
8585
}
8686

8787
tasks.named("yamlRestTest").configure {
88-
/*
89-
* We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each
90-
* other if we allow them to set the number of available processors as it's set-once in Netty.
91-
*/
92-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
9388
systemProperty 'tests.rest.blacklist', restTestBlacklist.join(',')
9489
dependsOn "copyExtraResources"
9590
}
@@ -156,12 +151,6 @@ def v7compatibilityNotSupportedTests = {
156151
}
157152

158153
tasks.named("yamlRestCompatTest").configure {
159-
/*
160-
* We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each
161-
* other if we allow them to set the number of available processors as it's set-once in Netty.
162-
*/
163-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
164-
165154
systemProperty 'tests.rest.blacklist', v7compatibilityNotSupportedTests().join(',')
166155
dependsOn "copyExtraResources"
167156
}

x-pack/plugin/core/build.gradle

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,6 @@ sourceSets.test.resources {
111111
srcDir 'src/main/config'
112112
}
113113

114-
tasks.named("test").configure {
115-
/*
116-
* We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each
117-
* other if we allow them to set the number of available processors as it's set-once in Netty.
118-
*/
119-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
120-
}
121-
122114
tasks.named("thirdPartyAudit").configure {
123115
ignoreMissingClasses(
124116
//commons-logging optional dependencies

x-pack/plugin/data-streams/build.gradle

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,3 @@ dependencies {
1616
}
1717

1818
addQaCheckDependencies()
19-
20-
tasks.named("internalClusterTest").configure {
21-
/*
22-
* We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each
23-
* other if we allow them to set the number of available processors as it's set-once in Netty.
24-
*/
25-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
26-
}

x-pack/plugin/identity-provider/build.gradle

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -341,18 +341,6 @@ tasks.named("thirdPartyAudit").configure {
341341
)
342342
}
343343

344-
tasks.named("test").configure {
345-
/*
346-
* We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each
347-
* other if we allow them to set the number of available processors as it's set-once in Netty.
348-
*/
349-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
350-
}
351-
352-
tasks.named("internalClusterTest").configure {
353-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
354-
}
355-
356344
addQaCheckDependencies()
357345

358346
if (BuildParams.inFipsJvm) {

x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ tasks.named("processJavaRestTestResources").configure { dependsOn("copyKeyCerts"
2626

2727
tasks.named("javaRestTest").configure {
2828
dependsOn "copyKeyCerts"
29-
/*
30-
* We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each
31-
* other if we allow them to set the number of available processors as it's set-once in Netty.
32-
*/
33-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
3429
}
3530

3631
testClusters.all {

x-pack/plugin/security/build.gradle

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -462,21 +462,7 @@ tasks.named("thirdPartyAudit").configure {
462462
)
463463
}
464464

465-
tasks.named("test").configure {
466-
/*
467-
* We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each
468-
* other if we allow them to set the number of available processors as it's set-once in Netty.
469-
*/
470-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
471-
}
472-
473465
tasks.named("internalClusterTest").configure {
474-
/*
475-
* We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each
476-
* other if we allow them to set the number of available processors as it's set-once in Netty.
477-
*/
478-
systemProperty 'es.set.netty.runtime.available.processors', 'false'
479-
480466
/*
481467
* 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
482468
* to keep direct memory usage under control.

0 commit comments

Comments
 (0)