Skip to content

Commit a078bb4

Browse files
committed
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
1 parent b89b0d5 commit a078bb4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

modules/transport-netty4/build.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* under the License.
1818
*/
1919

20+
import org.elasticsearch.gradle.test.RestIntegTestTask
21+
2022
/*
2123
TODOs:
2224
* fix permissions such that only netty4 can open sockets etc?
@@ -68,6 +70,22 @@ integTestRunner {
6870
systemProperty 'io.netty.allocator.numDirectArenas', '0'
6971
}
7072

73+
TaskProvider<Test> pooledTest = tasks.register("pooledTest", Test) {
74+
include '**/*Tests.class'
75+
systemProperty 'es.set.netty.runtime.available.processors', 'false'
76+
systemProperty 'io.netty.allocator.type', 'pooled'
77+
}
78+
// TODO: we can't use task avoidance here because RestIntegTestTask does the testcluster creation
79+
RestIntegTestTask pooledIntegTest = tasks.create("pooledIntegTest", RestIntegTestTask) {
80+
runner {
81+
systemProperty 'es.set.netty.runtime.available.processors', 'false'
82+
}
83+
}
84+
testClusters.pooledIntegTest {
85+
systemProperty 'io.netty.allocator.type', 'pooled'
86+
}
87+
check.dependsOn(pooledTest, pooledIntegTest)
88+
7189
thirdPartyAudit {
7290
ignoreMissingClasses (
7391
// classes are missing

0 commit comments

Comments
 (0)