ContextWithModuleTest test error when building openmrs-core

Hi everyone !

It has been few days that I am stuck with this issue. :expressionless:

Here is the details :

~/git/openmrs-core$ mvn clean install

runs accross the following test error at some point :

… Running org.openmrs.api.context.ContextWithModuleTest Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.933 sec <<< FAILURE! - in org.openmrs.api.context.ContextWithModuleTest loadClass_shouldLoadClassWithOpenmrsClassLoader(org.openmrs.api.context.ContextWithModuleTest) Time elapsed: 0.918 sec <<< ERROR! java.lang.NullPointerException: null at java.lang.String.startsWith(String.java:1393) at java.lang.String.startsWith(String.java:1422) …

Giving me the summary :

Results :

Tests in error: ContextWithModuleTest.cleanupAfterEachTest:41 » NullPointer

Tests run: 3084, Failures: 0, Errors: 1, Skipped: 29

[INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] OpenMRS … SUCCESS [2.512s] [INFO] openmrs-tools … SUCCESS [1.422s] [INFO] openmrs-test … SUCCESS [0.120s] [INFO] openmrs-api … FAILURE [2:18.988s] [INFO] openmrs-web … SKIPPED [INFO] openmrs-webapp … SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------

This is right out from the Git repository (master branch)

I can’t find where the problem is.

It builds properly within an LXC container in the same branch (and with the exact same Maven and Java version !). So does my colleague running on his Mac.

More details :

$ mvn -v Apache Maven 3.0.5 Maven home: /usr/share/maven Java version: 1.8.0_45, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-8-oracle/jre Default locale: en_US, platform encoding: UTF-8 OS name: “linux”, version: “3.13.0-55-generic”, arch: “amd64”, family: “unix”

$ javac -version javac 1.8.0_45

$ echo $JAVA_HOME /usr/lib/jvm/java-8-oracle

$ git status On branch master Your branch is up-to-date with ‘origin/master’.

Any idea ? What am I missing here ?

(I’ve tried different JVM (OpenJDK and Oracle) and Maven versions (3.2.? and 3.0.5), and different branches (latest and 1.9.9) - not better).

Thanks

[EDIT] The test class ContextWithModuleTest fails in Eclipse too

Here comes a little complication

When I run the test individually :

$ mvn test -Dtest=org.openmrs.api.context.ContextWithModuleTest

It passes :


T E S T S

Java HotSpot™ 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 Running org.openmrs.api.context.ContextWithModuleTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 14.699 sec - in org.openmrs.api.context.ContextWithModuleTest

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

And then, it passes in Eclipse too (individually) While as I said in my [EDIT], it didn’t pass before…

Still not working when I run

$ mvn clean install

See the full log of Maven : http://paste.ubuntu.com/11755097/ (error at line 488)

You do not seem to be the only one facing this as per: https://ci.openmrs.org/browse/TRUNK-MASTER-JOB1-962/test/case/2369226 and https://issues.openmrs.org/browse/TRUNK-4725

I have made an attempt to fix it. So pull the latest changes from master, compile again, and tell me if i should make a second attempt. :slight_smile:

Thanks dkayiwa. Problem solved with the last pull.