Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
36 changes: 17 additions & 19 deletions reactor-netty-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2025 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2020-2026 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -84,28 +84,28 @@ dependencies {
//transport resolution: typical build forces epoll but not kqueue transitively
//on the other hand, if we want to make transport-specific tests, we'll make all
// native optional at compile time and add correct native/nio to testRuntime
compileOnly "io.netty:netty-transport-native-kqueue:$nettyVersion"
compileOnly "io.netty.incubator:netty-incubator-transport-native-io_uring:$nettyIoUringVersion"
compileOnly "io.netty:netty-transport-native-io_uring:$nettyVersion"
testCompileOnly "io.netty:netty-transport-native-kqueue:$nettyVersion"
testCompileOnly "io.netty.incubator:netty-incubator-transport-native-io_uring:$nettyIoUringVersion"
java11TestCompileOnly "io.netty:netty-transport-native-io_uring:$nettyVersion"
if (project.hasProperty("forceTransport")) {
//so that the main code compiles
compileOnly "io.netty:netty-transport-native-epoll:$nettyVersion"
compileOnly "io.netty:netty-transport-native-kqueue:$nettyVersion"
compileOnly "io.netty.incubator:netty-incubator-transport-native-io_uring:$nettyIoUringVersion"
compileOnly "io.netty:netty-transport-native-io_uring:$nettyVersion"
testImplementation "io.netty:netty-transport-native-epoll:$nettyVersion"
testImplementation "io.netty:netty-transport-native-kqueue:$nettyVersion"
testImplementation "io.netty:netty-transport-native-io_uring:$nettyVersion"
testImplementation "io.netty.incubator:netty-incubator-transport-native-io_uring:$nettyIoUringVersion"
testCompileOnly "io.netty:netty-transport-native-epoll:$nettyVersion"
//now we explicitly add correctly qualified native, or do nothing if we want to test NIO
if (forceTransport == "native") {
if (osdetector.os == "osx") {
testImplementation "io.netty:netty-transport-native-kqueue:$nettyVersion$os_suffix"
testRuntimeOnly "io.netty:netty-transport-native-kqueue:$nettyVersion$os_suffix"
}
else if (osdetector.os == "linux") {
testImplementation "io.netty:netty-transport-native-epoll:$nettyVersion$os_suffix"
testRuntimeOnly "io.netty:netty-transport-native-epoll:$nettyVersion$os_suffix"
}
}
else if (forceTransport == "io_uring" && osdetector.os == "linux") {
testImplementation "io.netty:netty-transport-native-io_uring:$nettyVersion$os_suffix"
testImplementation "io.netty.incubator:netty-incubator-transport-native-io_uring:$nettyIoUringVersion$os_suffix"
testRuntimeOnly "io.netty.incubator:netty-incubator-transport-native-io_uring:$nettyIoUringVersion$os_suffix"
java11TestRuntimeOnly "io.netty:netty-transport-native-io_uring:$nettyVersion$os_suffix"
}
else if (forceTransport != "nio") {
throw new InvalidUserDataException("invalid -PforceTransport option " + forceTransport + ", should be native|nio|io_uring")
Expand All @@ -114,12 +114,6 @@ dependencies {
else {
//classic build to be distributed
api "io.netty:netty-transport-native-epoll:$nettyVersion:linux-x86_64"
compileOnly "io.netty:netty-transport-native-kqueue:$nettyVersion"
compileOnly "io.netty.incubator:netty-incubator-transport-native-io_uring:$nettyIoUringVersion"
compileOnly "io.netty:netty-transport-native-io_uring:$nettyVersion"
testImplementation "io.netty:netty-transport-native-kqueue:$nettyVersion"
testImplementation "io.netty:netty-transport-native-io_uring:$nettyVersion"
testImplementation "io.netty.incubator:netty-incubator-transport-native-io_uring:$nettyIoUringVersion"
}

//Metrics
Expand Down Expand Up @@ -207,7 +201,11 @@ java17Test {
jvmArgs = ["-XX:+AllowRedefinitionToAddDeleteMethods"]
}
java11Test {
classpath = sourceSets.main.output + sourceSets.test.runtimeClasspath
// Ensure runtime classpath includes test dependencies plus java11Test specific ones
// Exclude incubator io_uring from test.runtimeClasspath as java11 uses the new non-incubator version
classpath = sourceSets.main.output + (sourceSets.test.runtimeClasspath - configurations.testRuntimeClasspath.fileCollection {
it.group == 'io.netty.incubator' && it.name.contains('io_uring')
}) + sourceSets.java11Test.runtimeClasspath
}

components.java.withVariantsFromConfiguration(configurations.testFixturesApiElements) { skip() }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2025 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2017-2026 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,9 +24,8 @@
import io.netty.channel.epoll.Epoll;
import io.netty.channel.kqueue.KQueue;
import io.netty.channel.nio.NioIoHandler;
import io.netty.channel.uring.IoUring;
import io.netty.incubator.channel.uring.IOUring;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledForJreRange;
import org.junit.jupiter.api.condition.EnabledOnJre;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.JRE;
Expand Down Expand Up @@ -210,22 +209,12 @@ void testEpollIsAvailable() {
assertThat(Epoll.isAvailable()).isTrue();
}

@Test
@EnabledOnOs(OS.LINUX)
@EnabledForJreRange(min = JRE.JAVA_11)
void testIoUringIsAvailable() {
boolean isTransportIoUring = "io_uring".equals(System.getProperty("forceTransport"));
assumeThat(isTransportIoUring).isTrue();
assertThat(IoUring.isAvailable()).isTrue();
}

@Test
@EnabledOnOs(OS.LINUX)
@EnabledOnJre(JRE.JAVA_8)
void testIoUringIncubatorIsAvailableOnJava8() {
boolean isTransportIoUring = "io_uring".equals(System.getProperty("forceTransport"));
assumeThat(isTransportIoUring).isTrue();
assertThat(io.netty.incubator.channel.uring.IOUring.isAvailable()).isTrue();
assumeThat(System.getProperty("forceTransport")).isEqualTo("io_uring");
assertThat(IOUring.isAvailable()).isTrue();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2026 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package reactor.netty.resources;

import io.netty.channel.uring.IoUring;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.OS;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assumptions.assumeThat;

class LoopResourcesTest {

@Test
@EnabledOnOs(OS.LINUX)
void testIoUringIsAvailable() {
assumeThat(System.getProperty("forceTransport")).isEqualTo("io_uring");
assertThat(IoUring.isAvailable()).isTrue();
}
}
10 changes: 1 addition & 9 deletions reactor-netty-http/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2025 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2020-2026 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -89,11 +89,6 @@ dependencies {
//on the other hand, if we want to make transport-specific tests, we'll make all
// native optional at compile time and add correct native/nio to testRuntime
if (project.hasProperty("forceTransport")) {
//so that the main code compiles
compileOnly "io.netty:netty-transport-native-epoll:$nettyVersion"
compileOnly "io.netty:netty-transport-native-kqueue:$nettyVersion"
compileOnly "io.netty.incubator:netty-incubator-transport-native-io_uring:$nettyIoUringVersion"
compileOnly "io.netty:netty-transport-native-io_uring:$nettyVersion"
//now we explicitly add correctly qualified native, or do nothing if we want to test NIO
if (forceTransport == "native") {
if (osdetector.os == "osx") {
Expand All @@ -113,9 +108,6 @@ dependencies {
else {
//classic build to be distributed
api "io.netty:netty-transport-native-epoll:$nettyVersion:linux-x86_64"
compileOnly "io.netty:netty-transport-native-kqueue:$nettyVersion"
compileOnly "io.netty.incubator:netty-incubator-transport-native-io_uring:$nettyIoUringVersion"
compileOnly "io.netty:netty-transport-native-io_uring:$nettyVersion"
}

//Metrics
Expand Down