Skip to content

Commit 50470af

Browse files
authored
Test with jdk 24 and 25 ea (#3949)
1 parent e78c14d commit 50470af

File tree

10 files changed

+48
-7
lines changed

10 files changed

+48
-7
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,9 @@ jobs:
308308
distribution: 'temurin'
309309
- version: 21
310310
distribution: 'temurin'
311-
- version: 23
311+
- version: 24
312+
distribution: 'temurin'
313+
- version: '25-ea'
312314
distribution: 'temurin'
313315
steps:
314316
- uses: actions/checkout@v4

apm-agent-core/src/test/java/co/elastic/apm/agent/util/JdkVersionTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public class JdkVersionTest {
3333
private static List<Arguments> releaseSchedule() {
3434
// from https://www.oracle.com/java/technologies/java-se-support-roadmap.html
3535
return List.of(
36-
Arguments.of(24, LocalDate.parse("2025-04-01")),
3736
Arguments.of(25, LocalDate.parse("2025-10-01")),
3837
Arguments.of(26, LocalDate.parse("2026-04-01"))
3938
);

apm-agent-plugins/apm-awslambda-plugin/src/test/java/co/elastic/apm/agent/awslambda/AbstractLambdaTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ protected boolean supportsContextPropagation() {
149149
return true;
150150
}
151151

152+
152153
static synchronized void initAllButInstrumentation() {
154+
ElasticApmAgent.reset(); // reset the AbstractInstrumentationTest beforeAll initialization
153155
config = SpyConfiguration.createSpyConfig();
154156
serverlessConfiguration = config.getConfig(ServerlessConfigurationImpl.class);
155157
doReturn(true).when(serverlessConfiguration).runsOnAwsLambda();

apm-agent-plugins/apm-profiling-plugin/src/test/java/co/elastic/apm/agent/profiler/CallTreeSpanifyTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
import org.junit.jupiter.api.AfterEach;
3131
import org.junit.jupiter.api.BeforeEach;
3232
import org.junit.jupiter.api.Test;
33+
import org.junit.jupiter.api.condition.DisabledForJreRange;
3334
import org.junit.jupiter.api.condition.DisabledOnOs;
35+
import org.junit.jupiter.api.condition.JRE;
3436
import org.junit.jupiter.api.condition.OS;
3537
import org.stagemonitor.configuration.ConfigurationRegistry;
3638

@@ -67,6 +69,7 @@ void tearDown() throws IOException {
6769
@Test
6870
@DisabledOnOs(OS.WINDOWS)
6971
@DisabledOnAppleSilicon
72+
@DisabledForJreRange(min = JRE.JAVA_24)
7073
void testSpanification() throws Exception {
7174
CallTree.Root callTree = CallTreeTest.getCallTree(tracer, new String[]{
7275
" dd ",

apm-agent-plugins/apm-profiling-plugin/src/test/java/co/elastic/apm/agent/profiler/CallTreeTest.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,25 @@
2121
import co.elastic.apm.agent.MockReporter;
2222
import co.elastic.apm.agent.MockTracer;
2323
import co.elastic.apm.agent.configuration.SpyConfiguration;
24-
import co.elastic.apm.agent.impl.transaction.*;
25-
import co.elastic.apm.agent.tracer.configuration.TimeDuration;
2624
import co.elastic.apm.agent.impl.ElasticApmTracer;
2725
import co.elastic.apm.agent.impl.sampling.ConstantSampler;
26+
import co.elastic.apm.agent.impl.transaction.AbstractSpanImpl;
2827
import co.elastic.apm.agent.impl.transaction.SpanImpl;
28+
import co.elastic.apm.agent.impl.transaction.StackFrame;
29+
import co.elastic.apm.agent.impl.transaction.TraceContextImpl;
30+
import co.elastic.apm.agent.impl.transaction.TransactionImpl;
2931
import co.elastic.apm.agent.objectpool.NoopObjectPool;
3032
import co.elastic.apm.agent.objectpool.ObservableObjectPool;
3133
import co.elastic.apm.agent.objectpool.impl.ListBasedObjectPool;
3234
import co.elastic.apm.agent.testutils.DisabledOnAppleSilicon;
35+
import co.elastic.apm.agent.tracer.configuration.TimeDuration;
3336
import org.junit.jupiter.api.AfterEach;
3437
import org.junit.jupiter.api.BeforeEach;
3538
import org.junit.jupiter.api.Disabled;
3639
import org.junit.jupiter.api.Test;
40+
import org.junit.jupiter.api.condition.DisabledForJreRange;
3741
import org.junit.jupiter.api.condition.DisabledOnOs;
42+
import org.junit.jupiter.api.condition.JRE;
3843
import org.junit.jupiter.api.condition.OS;
3944
import org.stagemonitor.configuration.ConfigurationRegistry;
4045

@@ -57,6 +62,7 @@
5762

5863
@DisabledOnOs(OS.WINDOWS)
5964
@DisabledOnAppleSilicon
65+
@DisabledForJreRange(min = JRE.JAVA_24)
6066
class CallTreeTest {
6167

6268
private MockReporter reporter;

apm-agent-plugins/apm-profiling-plugin/src/test/java/co/elastic/apm/agent/profiler/SamplingProfilerQueueTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
import co.elastic.apm.agent.objectpool.ObjectPoolFactoryImpl;
2525
import co.elastic.apm.agent.testutils.DisabledOnAppleSilicon;
2626
import org.junit.jupiter.api.Test;
27+
import org.junit.jupiter.api.condition.DisabledForJreRange;
2728
import org.junit.jupiter.api.condition.DisabledOnOs;
29+
import org.junit.jupiter.api.condition.JRE;
2830
import org.junit.jupiter.api.condition.OS;
2931

3032
import static org.assertj.core.api.Assertions.assertThat;
@@ -35,6 +37,7 @@ public class SamplingProfilerQueueTest {
3537
@Test
3638
@DisabledOnOs(OS.WINDOWS)
3739
@DisabledOnAppleSilicon
40+
@DisabledForJreRange(min = JRE.JAVA_24)
3841
void testFillQueue() throws Exception {
3942
System.out.println(System.getProperty("os.name"));
4043

apm-agent-plugins/apm-profiling-plugin/src/test/java/co/elastic/apm/agent/profiler/SamplingProfilerTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
// async-profiler doesn't work on Windows
5757
@DisabledOnOs(OS.WINDOWS)
5858
@DisabledOnAppleSilicon
59+
@DisabledForJreRange(min = JRE.JAVA_24)
5960
class SamplingProfilerTest {
6061

6162
private MockReporter reporter;

docs/reference/config-profiling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The inferred spans are created after a profiling session has ended. This means t
6363
Only platform threads are supported. Virtual threads are not supported and will not be profiled.
6464

6565
::::{note}
66-
This feature is not available on Windows and on OpenJ9
66+
This feature is not available on Windows and on OpenJ9. In addition only Java 7 to Java 23 are supported.
6767
::::
6868

6969

integration-tests/spring-boot-1-5/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,16 @@
7676
</dependency>
7777
</dependencies>
7878

79+
<build>
80+
<plugins>
81+
<plugin>
82+
<groupId>org.apache.maven.plugins</groupId>
83+
<artifactId>maven-failsafe-plugin</artifactId>
84+
<configuration>
85+
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
86+
</configuration>
87+
</plugin>
88+
</plugins>
89+
</build>
90+
7991
</project>

pom.xml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
<!-- -dependencies versions -->
117117
<version.error_prone>2.2.0</version.error_prone>
118118
<version.h2>1.4.196</version.h2>
119-
<version.junit>5.9.1</version.junit>
119+
<version.junit>5.12.2</version.junit>
120120
<version.junit.vintage>4.13.2</version.junit.vintage>
121121
<version.okhttp>4.12.0</version.okhttp>
122122
<!-- this is the last version of slf4j that is compatible with Java 7-->
@@ -476,6 +476,19 @@
476476
</executions>
477477
</plugin>
478478
<plugin>
479+
<!--
480+
Note that we don't actively use jacoco anymore, but for reasons beyond my understanding the tests will fail if we remove it.
481+
When removing jacoco, some tests will fail deterministically with a java.lang.VerifyError: null during retransformation
482+
of the classes under test. I extracted the bytecode from the failed tests and verified it manually using the ASM CheckClassAdapter,
483+
there the bytecode looks fine and is validated without issues.
484+
My best guess of an explanation for this behaviour is that we cause some kind of obscure JVM bug during our tests, because
485+
we continuously retransform classes. This "bug" seems to be prevented by having multiple agents in the JVM (e.g. running the tests
486+
from IntelliJ with IntelliJ's debug agent also makes them succeed.
487+
This seems to happen only due to the runtime attachment of the agent in the tests,
488+
because we have never seen these kinds of problems in production systems.
489+
490+
So for now I've decided to just let it be and leave jacoco in here.
491+
-->
479492
<groupId>org.jacoco</groupId>
480493
<artifactId>jacoco-maven-plugin</artifactId>
481494
<configuration>
@@ -596,7 +609,7 @@
596609
<plugin>
597610
<groupId>org.jacoco</groupId>
598611
<artifactId>jacoco-maven-plugin</artifactId>
599-
<version>0.8.8</version>
612+
<version>0.8.13</version>
600613
</plugin>
601614
<plugin>
602615
<groupId>org.codehaus.mojo</groupId>

0 commit comments

Comments
 (0)