Skip to content

Commit 17f58ed

Browse files
authored
Run tests with jdk 22 (#11191)
1 parent c015758 commit 17f58ed

File tree

5 files changed

+34
-7
lines changed

5 files changed

+34
-7
lines changed

.github/workflows/build-common.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ jobs:
182182
- 11
183183
- 17
184184
- 21
185+
- 22
185186
vm:
186187
- hotspot
187188
- openj9
@@ -192,7 +193,7 @@ jobs:
192193
- 3
193194
exclude:
194195
- vm: ${{ inputs.skip-openj9-tests && 'openj9' || '' }}
195-
- test-java-version: 21
196+
- test-java-version: 22
196197
vm: openj9
197198
fail-fast: false
198199
steps:

docs/supported-libraries.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,10 @@ These are the application servers that the smoke tests are run against:
205205

206206
These are the JVMs and operating systems that the integration tests are run against:
207207

208-
| JVM | Versions | OS |
209-
| ----------------------------------------------------------------------------------------- |---------------| ------------------------------------- |
210-
| [OpenJDK (Eclipse Temurin)](https://adoptium.net/) | 8, 11, 17, 21 | [`ubuntu-latest`], [`windows-latest`] |
211-
| [OpenJ9 (IBM Semeru Runtimes)](https://developer.ibm.com/languages/java/semeru-runtimes/) | 8, 11, 17 | [`ubuntu-latest`] |
208+
| JVM | Versions | OS |
209+
| ----------------------------------------------------------------------------------------- |-------------------| ------------------------------------- |
210+
| [OpenJDK (Eclipse Temurin)](https://adoptium.net/) | 8, 11, 17, 21, 22 | [`ubuntu-latest`], [`windows-latest`] |
211+
| [OpenJ9 (IBM Semeru Runtimes)](https://developer.ibm.com/languages/java/semeru-runtimes/) | 8, 11, 17, 21 | [`ubuntu-latest`] |
212212

213213
## Disabled instrumentations
214214

instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/internal/ClassNames.java

+13-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,21 @@ public static String simpleName(Class<?> type) {
2626
}
2727

2828
private static String computeSimpleName(Class<?> type) {
29+
String className = type.getName();
2930
if (!type.isAnonymousClass()) {
30-
return type.getSimpleName();
31+
String simpleName = type.getSimpleName();
32+
// on openj9 21 simple name for lambda classes is an empty string
33+
if (!simpleName.isEmpty()) {
34+
return simpleName;
35+
} else {
36+
// handle lambda names on openj9 21
37+
// only lambda class names contain /
38+
int index = className.indexOf('/');
39+
if (index != -1) {
40+
className = className.substring(0, index);
41+
}
42+
}
3143
}
32-
String className = type.getName();
3344
if (type.getPackage() != null) {
3445
String pkgName = type.getPackage().getName();
3546
if (!pkgName.isEmpty()) {

instrumentation/hibernate/hibernate-reactive-1.0/javaagent/build.gradle.kts

+7
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,10 @@ tasks {
8383
dependsOn(testing.suites)
8484
}
8585
}
86+
87+
if (!latestDepTest) {
88+
// https://bugs.openjdk.org/browse/JDK-8320431
89+
otelJava {
90+
maxJavaVersionForTests.set(JavaVersion.VERSION_21)
91+
}
92+
}

instrumentation/vertx/vertx-sql-client-4.0/javaagent/build.gradle.kts

+8
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ tasks {
2626
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
2727
}
2828
}
29+
30+
val latestDepTest = findProperty("testLatestDeps") as Boolean
31+
if (!latestDepTest) {
32+
// https://bugs.openjdk.org/browse/JDK-8320431
33+
otelJava {
34+
maxJavaVersionForTests.set(JavaVersion.VERSION_21)
35+
}
36+
}

0 commit comments

Comments
 (0)