OpenMRS-core build failure

Sytem Ubuntu 16.04 maven version 3.3.9 Java version 1.8.0_151

I am trying to build a cloned repo of openmrs-core with no success. I keep on getting these errors

Failed Tests Tests run: 55, Failures: 2, Errors: 0, Skipped: 4, Time elapsed: 0.5 sec <<< FAILURE! - in org.openmrs.api.AdministrationServiceTest getAllGlobalProperties_shouldReturnAllGlobalPropertiesInTheDatabase(org.openmrs.api.AdministrationServiceTest) Time elapsed: 0.012 sec <<< FAILURE! java.lang.AssertionError: expected:<21> but was:<25> at org.junit.Assert.fail(Assert.java:88) at org.junit.Assert.failNotEquals(Assert.java:834) at org.junit.Assert.assertEquals(Assert.java:645) at org.junit.Assert.assertEquals(Assert.java:631) at org.openmrs.api.AdministrationServiceTest.getAllGlobalProperties_shouldReturnAllGlobalPropertiesInTheDatabase(AdministrationServiceTest.java:449)

purgeGlobalProperty_shouldDeleteGlobalPropertyFromDatabase(org.openmrs.api.AdministrationServiceTest) Time elapsed: 0.008 sec <<< FAILURE! java.lang.AssertionError: expected:<21> but was:<25> at org.junit.Assert.fail(Assert.java:88) at org.junit.Assert.failNotEquals(Assert.java:834) at org.junit.Assert.assertEquals(Assert.java:645) at org.junit.Assert.assertEquals(Assert.java:631) at org.openmrs.api.AdministrationServiceTest.purgeGlobalProperty_shouldDeleteGlobalPropertyFromDatabase(AdministrationServiceTest.java:514)

Final results Results :

Failed tests: AdministrationServiceTest.getAllGlobalProperties_shouldReturnAllGlobalPropertiesInTheDatabase:449 expected:<21> but was:<25> AdministrationServiceTest.purgeGlobalProperty_shouldDeleteGlobalPropertyFromDatabase:514 expected:<21> but was:<25>

Tests run: 3773, Failures: 2, Errors: 0, Skipped: 38

[INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] OpenMRS … SUCCESS [ 3.467 s] [INFO] openmrs-tools … SUCCESS [ 1.912 s] [INFO] openmrs-test … SUCCESS [ 0.133 s] [INFO] openmrs-api … FAILURE [13:59 min] [INFO] openmrs-web … SKIPPED [INFO] openmrs-webapp … SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 14:05 min

I have tried the solutions on several linked posts with no success. Has someone encountered this and has a different solution ? Also what may be the cause of this considering i haven’t made any local changes?

Hello @ekirapa next time please post your logs at pastebin.com if you do not mind,

now just to know which core version are you building?

Hi @tendomart thanks that’s noted. I am building OpenMRS 2.2.0

alright so the drop the complete logs there.

@ekirapa does it help if you upgrade to the latest version of Java 1.8?

That doesn’t seem to fix the problem. Still getting the same errors

Here is the full log output https://pastebin.com/BtLQKGV2

What does this return? mvn -version

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T19:41:47+03:00)
Maven home: /usr/local/maven
Java version: 1.8.0_152, vendor: Oracle Corporation
Java home: /usr/lib/jvm/jdk1.8.0_152/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.10.0-42-generic", arch: "amd64", family: "unix"

What happens when you run this? mvn -Dtest=AdministrationServiceTest test

That seems to build successfully . Here is the full logs https://pastebin.com/nqtJgpUQ

What happens if, at the beginning of each of the two tests that fail, you put this? Context.clearSession();

That too didn’t work .

Looks like this will require lots of options to try out. Catch me on IRC whenever you get some time.

@ekirapa Were you able to find a solution? I seem to be getting the error while trying to build and the build environment is exactly similar to yours.

am actualy also getting the same problem @dkayiwa

@mozzy Can you paste your build log at pastebin.com?

here @dkayiwa https://pastebin.com/DmseyPAM

What you are reporting is different from what he reported. His report is about getting test failure of an openmrs-core compilation without any changes. Are you sure you are facing the same?

oh sorry, mine is am building the emrAPI module. thats y i created a new talk post here