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

CI support for parallel test execution

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      CI build servers often want to use multiple compute resources to reduce build times in exchange for additional CPU costs.

      One of the biggest consumers of build time is test execution, so much so that people are often willing to run multiple builds in parallel on different machines in order to get the total testing wall clock time lower.

      For example: https://wiki.jenkins.io/display/JENKINS/Parallel+Test+Executor+Plugin

      It would be nice if surefire made all this easier and more CI system agnostic.

      We already have some of this available: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#runOrder has the option balanced that will use a statistics file .surefire-XXXXXXXXX to distribute tests between different parallel worker threads.

      What is needed to make this better is the ability to use the balanced run ordering across Maven JVMs.

      If we had two system properties:

      • surefire.mvnCount
      • surefire.mvnOffset

      Then surefire could use the balanced run order to deterministically decide the ordered list of tests... it would then start at mvnOffset and run every {{mvnCount}}th test.

      CI users could then run three maven builds in parallel:

      • mvn -Dsurefire.mvnCount=3 -Dsurefire.mvnOffset=0 test
      • mvn -Dsurefire.mvnCount=3 -Dsurefire.mvnOffset=1 test
      • mvn -Dsurefire.mvnCount=3 -Dsurefire.mvnOffset=2 test

      This would ensure that all the tests are run once, but the wall clock time should be best case approx 1/3th of the wall clock for the full build time

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              stephenc Stephen Connolly
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: