matterhorn-capture-admin-service-impl testUpdatedTimeSinceLastUpdate race condition failure

Steps to reproduce

Steps to reproduce:
1. On a fast system, run "mvn clean install -DskipTests=false -DdeployTo=/opt/matterhorn -rf :matterhorn-capture-admin-service-impl -X -e"

Actual Results: The tests fail the build...

10:11:13 INFO (CaptureAgentStateServiceImpl:602) - Recording id 'Recording1' is not a long, assuming an unscheduled capture
Tests run: 17, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.246 sec <<< FAILURE!
testUpdatedTimeSinceLastUpdate(org.opencastproject.capture.admin.impl.CaptureAgentStateServiceImplTest) Time elapsed: 0.574 sec <<< FAILURE!
at junit.framework.Assert.assertTrue(
at junit.framework.Assert.assertTrue(
at org.opencastproject.capture.admin.impl.CaptureAgentStateServiceImplTest.testUpdatedTimeSinceLastUpdate(
Results :

Failed tests:

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

Expected Results: The test succeed and the build continues.

Workaround (if any): The issue is caused by a race condition in the unit test "lastHeardFrom < agent.getLastHeardFrom()". The calls on the agent happen to quickly on a fast machine which causes the call times to match. The work-around is to run the test many times until you win the race condition, or to add a delay pause in the test between the two calls to the agent, or to change the test evaluation from "<" to "<=" .

Fixed and reviewed
Your pinned fields
Click on the next to a field label to start pinning.


Former user


Former user


Build Error