Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1264

Some tests can be lost when running in parallel with parameterized tests

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.19.1
    • 2.20.1
    • None
    • Maven 3.3.9
      Java 1.8.0_45 (Oracle)
      System: OS X

      Reproduced on Linux too, with both OpenJDK 7 and Java 7 from Oracle.

    Description

      Hello,

      It appears some tests can be lost when using the parallel mode with parameterized tests. Here is a small project I've used to try to reproduce the issue we have seen.

      This is not something that happens on every run, but it's quite frequent.

      With this loop, the problem should appear in less than 2 minutes, maybe on the first run when (un)lucky:

      time while true; do mvn clean test > last.log ; tail -25 last.log ; if [ "$(grep -c 'Tests run: 12' last.log)" == "0" ]; then break; fi ; done
      

      Normal run:

      -------------------------------------------------------
       T E S T S
      -------------------------------------------------------
      Running [p2]
      com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p2] - p2 - sleeptime = 1 => start
      com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p2] - p2 - sleeptime = 1 => stop
      com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p1] - p1 - sleeptime = 2 => start
      com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p1] - p1 - sleeptime = 2 => stop
      com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p0] - p0 - sleeptime = 5 => start
      com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p0] - p0 - sleeptime = 5 => stop
      Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.006 sec - in [p2]
      Running [p2]
      Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 sec - in [p2]
      
      Results :
      
      Tests run: 12, Failures: 0, Errors: 0, Skipped: 0
      

      When tests have been lost (here one test lost according to the output):

      -------------------------------------------------------
       T E S T S
      -------------------------------------------------------
      Running [p2]
      com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p0] - p0 - sleeptime = 5 => start
      com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p2] - p2 - sleeptime = 1 => start
      com.appnexus.viewability.core.surefireJunitTests.ATest.methodA1[p1] - p1 - sleeptime = 2 => start
      Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec - in [p2]
      Running [p2]
      Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.012 sec - in [p2]
      
      Results :
      
      Tests run: 11, Failures: 0, Errors: 0, Skipped: 0
      

      Note: there are 3 test classes and 18 tests on the master branch and it's even more frequent/easy to reproduce.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            tibordigana Tibor Digana
            jderrien Jean-Luc Derrien
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Time Spent - 144h Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - 144h Remaining Estimate - 24h
                144h

                Slack

                  Issue deployment