accumulo icon indicating copy to clipboard operation
accumulo copied to clipboard

Add java 21 variant to GitHub actions build

Open dlmarion opened this issue 2 years ago • 13 comments

dlmarion avatar Oct 04 '23 16:10 dlmarion

Failed for 2.1 build, switched to 3.1

dlmarion avatar Oct 04 '23 16:10 dlmarion

Failed on 2.1 branch with build errors in the VFS ClassLoader. On the 3.1 branch it's failing on Key.java.

dlmarion avatar Oct 04 '23 16:10 dlmarion

I fixed some of the errors in 99e7ecd. Currently at the point where tests using PowerMock are failing. I think PowerMock might need to be ripped out at this point.

dlmarion avatar Oct 05 '23 16:10 dlmarion

Currently at the point where tests using PowerMock are failing. I think PowerMock might need to be ripped out at this point.

What problem is powermock causing w/ jdk21? Like does it cause unit test to fail or a maven plugin to fail.

keith-turner avatar Oct 05 '23 17:10 keith-turner

Currently at the point where tests using PowerMock are failing. I think PowerMock might need to be ripped out at this point.

What problem is powermock causing w/ jdk21? Like does it cause unit test to fail or a maven plugin to fail.

[ERROR] org.apache.accumulo.coordinator.CompactionCoordinatorTest.testCoordinatorColdStartNoCompactions -- Time elapsed: 1.460 s <<< ERROR!
java.lang.IllegalStateException: Failed to transform class with name org.apache.accumulo.coordinator.CompactionCoordinatorTest$TestCoordinator. Reason: Cannot read field "string" because "utf" is null
	at org.powermock.core.classloader.javassist.JavassistMockClassLoader.defineAndTransformClass(JavassistMockClassLoader.java:119)
	at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:174)
	at org.powermock.core.classloader.MockClassLoader.loadClassByThisClassLoader(MockClassLoader.java:102)
	at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass1(DeferSupportingClassLoader.java:147)
	at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:98)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:421)
	at java.base/java.lang.Class.forName(Class.java:412)
	at javassist.runtime.Desc.getClassObject(Desc.java:72)
	at javassist.runtime.Desc.getClassType(Desc.java:181)
	at javassist.runtime.Desc.getType(Desc.java:151)
	at javassist.runtime.Desc.getType(Desc.java:107)
	at org.apache.accumulo.coordinator.CompactionCoordinatorTest.testCoordinatorColdStartNoCompactions(CompactionCoordinatorTest.java:231)

Looking at the PowerMock mailing list and GitHub, I think it might be dead. Last commit back in Feb 2022, last release in 2020.

dlmarion avatar Oct 05 '23 17:10 dlmarion

Looking at the PowerMock mailing list and GitHub, I think it might be dead. Last commit back in Feb 2022, last release in 2020.

That is a good find from trying to build with 21

keith-turner avatar Oct 05 '23 17:10 keith-turner

PowerMock is used to in 2 places, the unit tests for the Compactor and CompactionCoordinator. I wonder if we can just delete these unit tests, we have coverage on their functionality in the ITs.

dlmarion avatar Oct 05 '23 17:10 dlmarion

Mockito may also be an alternative.

EdColeman avatar Oct 05 '23 17:10 EdColeman

Mockito may also be an alternative.

I looked at their site and mailing list and did not get a good feel that it would work with Java 21 at this point either.

dlmarion avatar Oct 05 '23 17:10 dlmarion

Created #3817 to discuss removing the tests and PowerMock.

dlmarion avatar Oct 05 '23 17:10 dlmarion

I'm wondering if we should just close this PR and punt on Java 21 source compatibility for now.

dlmarion avatar Oct 05 '23 21:10 dlmarion

I'm wondering if we should just close this PR and punt on Java 21 source compatibility for now.

Can just leave it open until we work through the issues. No need to close it. It's useful to track the status.

ctubbsii avatar Oct 05 '23 21:10 ctubbsii

I'm wondering if we should just close this PR and punt on Java 21 source compatibility for now.

It feels like this JDK version has improved the static analysis it does, so maybe there is some benefit to running it as part of the build.

keith-turner avatar Oct 05 '23 21:10 keith-turner