I’m currently working on a project for my university course, and I recently cloned the OpenMRS repository (master branch) to run some tests and experiment with the platform.
However, when I attempt to build the project using JDK 8 and Maven 3.8.8, I encounter the following error during the test phase:
I’ve made sure that my environment is set up correctly, but I’m not sure why this error is occurring. Has anyone faced a similar issue or have any suggestions on how to resolve it?
[ERROR] org.openmrs.web.filter.update.GZIPFilterTest.zipRequestWrapperTest_shouldReturnTrueIfUnzippedContentReadFromWrapperIsTheSameAsContentBeforeZipping -- Time elapsed: 0.004 s <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.openmrs.api.context.Context
at org.openmrs.util.OpenmrsUtil.getApplicationDataDirectoryAsFile(OpenmrsUtil.java:977)
at org.openmrs.util.OpenmrsUtil.getApplicationDataDirectory(OpenmrsUtil.java:965)
at org.openmrs.test.TestUtil.getRuntimeProperties(TestUtil.java:86)
at org.openmrs.test.jupiter.BaseContextSensitiveTest.getRuntimeProperties(BaseContextSensitiveTest.java:306)
at org.openmrs.test.jupiter.BaseContextSensitiveTest.<init>(BaseContextSensitiveTest.java:199)
at org.openmrs.web.test.BaseWebContextSensitiveTest.<init>(BaseWebContextSensitiveTest.java:30)
at org.openmrs.web.filter.update.GZIPFilterTest.<init>(GZIPFilterTest.java:40)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.util.Optional.orElseGet(Optional.java:267)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at java.util.ArrayList.forEach(ArrayList.java:1259)
[ERROR] org.openmrs.web.filter.update.GZIPFilterTest -- Time elapsed: 0.282 s <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.openmrs.api.context.Context
at org.openmrs.test.jupiter.BaseContextSensitiveTest.closeSessionAfterEachClass(BaseContextSensitiveTest.java:1026)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1082)
at java.util.ArrayList.forEach(ArrayList.java:1259)
[INFO] Running org.openmrs.web.filter.update.util.FilterUtilTest
[ERROR] Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 0.034 s <<< FAILURE! -- in org.openmrs.web.filter.update.util.FilterUtilTest
Looks very much like the errors you mentioned that are showing on some of the CI builds for OpenMRS core. You thought there was a pattern of the tests passing on one CI worker but consistently failing on the others. I took a quick look at disk space and it appeared very similar across the Bamboo workers. Given the similar error is happening for people locally (and Wikum mentioned he has seen it on GitHub actions), it suggests the problem may not be specific to the Bamboo agents.
I think @wikumc was referring to another type of error on github actions. Not this one.
@burke this is the interesting pattern, if you rerun opemrs-core’s bamboo CI build for the master branch, on the agent named yu.openmrs.org, it will pass. But it will fail for each of the remaining two agents xindi.openmrs.org and xiao.openmrs.org. And this happens consistently. I mean that the passing on yu and failing on xindi and xiao does not happen randomly, it is 100 consistent. Leading me to think that those two agents on which it fails have an environment attribute similar to what @francistena1992 has, that triggers it. And that is what i am trying to find out.