Given the error it seems as though its not apparently related to the method in EncounterService causing extreme slowness nor the tests for the EncounterService that located in the org.openmrs.api.EncounterServiceTest class. But rather the errors you are seeing are from unit tests because they expected a certain result but got a different one;
HibernateAlertDAOTest.getAlerts_shouldReturnAllAlertsWhenUserIsSpecified: This test was expecting to receive 0 alerts but actually received 1.
HibernateAlertDAOTest.getAllAlerts_shouldReturnOnlyNonExpiredAllerts: This test was also expecting to receive 0 alerts but actually received 1.
You may need to investigate the code and the tests to determine what is causing the unexpected behavior.
But again if this is not related to the issue, i would suggest you provide logs for any errors or warnings related to the EncounterService and then do profiling to determine the methods and operations related to the slowness. Am not sure about the tools OpenMRS uses here but it would be important to investigate and compare the performance differences .
Hallo I worked around these errors by changing the value of the AssertEquals to 0 in the methods HibernateAlertDAOTest.getAllAlerts_shouldReturnOnlyNonExpiredAllerts() and HibernateAlertDAOTest.getAlerts_shouldReturnAllAlertsWhenUserIsSpecified().
After that I run mvn clean install and the build was successful.
Though my question is why were these methods coded to test if AssertEquals equals 1?
@suubi7 Am not certain if you got a chance to look at the previous comments on the ticket especially the one made by Darius. The changes to be made are supposed to be on 2.x branch. To switch to 2.x branch on your forked repo kindly follow this steps:
git fetch --all (To fetch all branches from all remotes)
git branch --all (To list all the branches you have)
git checkout 2.x (Ensure its among the listed branches)
git checkout -b TRUNK-5362