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

Test Java 24-ea #13376

Merged
merged 5 commits into from
Mar 5, 2025
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/build-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ jobs:
- 17
- 21
- 23
- 24-ea
vm:
- hotspot
- openj9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@
import java.lang.reflect.Method;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicBoolean;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Test;

class VirtualThreadTest {

@Test
void testDisableContextPropagation() throws Exception {
// VirtualThread does not have executeOnCarrierThread method in jdk24
Assumptions.assumeTrue(
Double.parseDouble(System.getProperty("java.specification.version")) < 24);

TestRunnable testRunnable = new TestRunnable();
Thread thread = Thread.ofVirtual().start(testRunnable);
thread.join();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,13 @@ public void visitMethodInsn(
super.visitMethodInsn(opcode, owner, name, descriptor, isInterface);
// if current instruction is a call to ASM ClassWriter.toByteArray() insert call to
// our lambda transformer
if (opcode == Opcodes.INVOKEVIRTUAL
&& "toByteArray".equals(name)
&& "()[B".equals(descriptor)) {
if ((opcode == Opcodes.INVOKEVIRTUAL
&& "toByteArray".equals(name)
&& "()[B".equals(descriptor))
// jdk 24
|| (opcode == Opcodes.INVOKEINTERFACE
&& "build".equals(name)
&& descriptor.endsWith(")[B"))) {
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitFieldInsn(
Opcodes.GETFIELD, slashClassName, "lambdaClassName", "Ljava/lang/String;");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ dependencies {
testInstrumentation(project(":instrumentation:jaxrs:jaxrs-2.0:jaxrs-2.0-cxf-3.2:javaagent"))
}

otelJava {
// due to security manager deprecation this test does not work on jdk 24 with default configuration
maxJavaVersionForTests.set(JavaVersion.VERSION_23)
}

tasks.withType<Test>().configureEach {
// required on jdk17
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ dependencies {
testInstrumentation(project(":instrumentation:jaxws:jaxws-jws-api-1.1:javaagent"))
}

otelJava {
// due to security manager deprecation this test does not work on jdk 24 with default configuration
maxJavaVersionForTests.set(JavaVersion.VERSION_23)
}

tasks.withType<Test>().configureEach {
// required on jdk17
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ dependencies {
latestDepTestLibrary("org.springframework.boot:spring-boot:2.+") // documented limitation
}

otelJava {
// due to security manager deprecation this test does not work on jdk 24 with default configuration
maxJavaVersionForTests.set(JavaVersion.VERSION_23)
}

tasks.withType<Test>().configureEach {
jvmArgs("-Djava.rmi.server.hostname=127.0.0.1")
}
Expand Down
Loading