UserServiceTest fails in surefire but not in eclipse

I had the following test failure when building openmrs core.

Test set: org.openmrs.api.UserServiceTest
-------------------------------------------------------------------------------
Tests run: 80, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 4.811 sec <<< FAILURE! - in org.openmrs.api.UserServiceTest
getAllPrivileges_shouldReturnAllPrivilegesInTheSystem(org.openmrs.api.UserServiceTest)  Time elapsed: 0.07 sec  <<< FAILURE!
junit.framework.AssertionFailedError: expected:<1> but was:<150>
	at junit.framework.Assert.fail(Assert.java:57)
	at junit.framework.Assert.failNotEquals(Assert.java:329)
	at junit.framework.Assert.assertEquals(Assert.java:78)
	at junit.framework.Assert.assertEquals(Assert.java:234)
	at junit.framework.Assert.assertEquals(Assert.java:241)
	at org.openmrs.api.UserServiceTest.getAllPrivileges_shouldReturnAllPrivilegesInTheSystem(UserServiceTest.java:490)

I have run the test case manually in eclipse but i don’t get any failures. I don’t know why it fails during installation.

Are you building the master branch? Is this the only failing test? What operating system? What exact JDK version? What version of maven?

hi dkayiwa.

I don’t know if i can answer some of those questions since i am new to open source. But i was following instructions on the getting started as a developer. I just did a git clone on the url provided by the manual (https://github.com/openmrs/openmrs-core.git) so i can’t tell which version of open mrs i was building.

java -version java version “1.8.0_45” Java™ SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot™ 64-Bit Server VM (build 25.45-b02, mixed mode)

mvn -v Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T12:57:37+01:00) Maven home: /home/m0dz3r0/applications/omrssdk-1.0.7/apache-maven Java version: 1.8.0_45, vendor: Oracle Corporation Java home: /opt/jdk1.8.0_45/jre Default locale: en_US, platform encoding: UTF-8 OS name: “linux”, version: “3.13.0-57-generic”, arch: “amd64”, family: “unix”

OS version: Ubuntu 14.04

I can’t say if that is the only test failure since i searched the files manually and may have missed some but that is all that i found. Thanks

This is a strange test failure. Are you available on IRC such that we can look into this together? Just ping dkayiwa when you are there. https://wiki.openmrs.org/display/IRC/Home

Looks like a random failure. Similar to https://travis-ci.org/openmrs/openmrs-core/builds/71758902 Of late, i see a couple more of such random failures even on bamboo. Looking into it.