smallrye / smallrye-config

SmallRye Config - A Java Configuration library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CDIPropertyNameMatchingTest fails when running with Java 21

tevans78 opened this issue · comments

MP Config TCK test fails using Java 21 - CDIPropertyNameMatchingTest.testPropertyFromEnvironmentVariables

Passes with Java 17. Fails with Java 21.
Passes with SmallRye Config 3.3.4. Fails on version 3.4.x.

java --version
openjdk 21 2023-09-19
OpenJDK Runtime Environment (build 21+35-2513)
OpenJDK 64-Bit Server VM (build 21+35-2513, mixed mode, sharing)
[ERROR] Tests run: 240, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.651 s <<< FAILURE! -- in TestSuite
[ERROR] org.eclipse.microprofile.config.tck.CDIPropertyNameMatchingTest.testPropertyFromEnvironmentVariables -- Time elapsed: 0.003 s <<< FAILURE!
java.lang.AssertionError:

Expected: is "haha"
     but: was "woohoo"
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
	at org.eclipse.microprofile.config.tck.CDIPropertyNameMatchingTest.testPropertyFromEnvironmentVariables(CDIPropertyNameMatchingTest.java:111)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139)
	at org.testng.internal.invokers.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:258)
	at org.jboss.arquillian.testng.Arquillian$3.invoke(Arquillian.java:146)
	at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:57)

@radcortez could this be related to #987 ?

No idea, but the change works for 11 and 17, I don't see a reason for it not to work with 21. I'll add a runner for 21 and check.

Added the Java 21 builder here and all the tests passed: #1039

@radcortez ok, that is interesting ... do you know exactly which JVM that is using? Mine is a couple of months old now, maybe it needs updating?

I've tried locally with:

openjdk 21 2023-09-19 LTS
OpenJDK Runtime Environment Temurin-21+35 (build 21+35-LTS)
OpenJDK 64-Bit Server VM Temurin-21+35 (build 21+35-LTS, mixed mode, sharing)

Github actions v1 uses Azul Zulu OpenJDK.

I've just tested locally with Zulu and Temurin and I still get the same failure. I will try to grab a Linux VM and try that instead of my Mac (Sonoma).

Using a completely fresh RHEL 9.2 VM with Temurin 21, it still fails for me.

openjdk 21.0.1 2023-10-17 LTS
OpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.1+12 (build 21.0.1+12-LTS, mixed mode, sharing)