Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-3765

Parallelized test runner does not wait for test completion



    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0.25, 1.2.9, 1.3.12
    • 1.0.26, 1.2.10, 1.3.13, 1.4
    • jcr
    • None


      As analyzed by tomek.rekawek in OAK-3743:

      Quote from the mailing list:

      On a “slow” machine, in the surefire logs for the AtomicCounterTest (which takes 63 sec while it should 3 sec), following test case appears:

        <testcase time="2.261" classname="org.apache.jackrabbit.oak.jcr.RepositoryTest" name="importWithRegisteredType[RDBDocumentStore on jdbc:derby:oaktest\;create=true]"/>

      It’s a test case from a completely different class. I downloaded all the surefire reports and it seems that the test cases from the RepositoryTest class are spread across CRUDTest, ConflictResolutionTest, ObservationTest and others. On the “fast” machines the problem doesn’t exist and all RepositoryTest methods are invoked within their own test case.

      It seems that this behaviour is caused by the org.apache.jackrabbit.oak.jcr.Parallelized runner, used in the AbstractRepositoryTest. JUnit submits a Runnable wrapping all the test cases from a single class to the ThreadPoolScheduler#schedule() method and then invokes #finished(). The latter waits for 10 minutes until the submitted Runnable is done. However, in case of the RepositoryTest, all tests takes more than 10 minutes. The finished() method simply returns, JUnit invokes another test class, while the RepositoryTest is still running in the background.

      In the attached patch, the finished() method waits indefinitely until all tests are done. It may seem a bit radical, but after all it's the same behaviour as in single-thread JUnit runner, which doesn't have internal timeout as well.


        Issue Links



              reschke Julian Reschke
              reschke Julian Reschke
              0 Vote for this issue
              2 Start watching this issue