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

The total amount of threads are not used with test classes nested by Enclosed.class.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.16, 2.17
    • None
    • None
    • JDK 7 on Linux
      JUnit 4.11

    Description

      It seems that the total amount of threads are not used with test classes nested by Enclosed.class.
      For example, I created a project with the following setting.

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.17</version>
        <configuration>
          <parallel>classes</parallel>
          <threadCount>4</threadCount>
          <perCoreThreadCount>false</perCoreThreadCount>
        </configuration>
      </plugin>
      

      And, create 4 test classes like the following.

      @RunWith(Enclosed.class)
      public class Test {
      
          public static class InnerTest {
              @Test
              public void test1() throws InterruptedException {
                  Thread.sleep(1000l);
              }
          }
      
      }
      

      It takes 4 seconds to execute the 4 tests.
      With 2.15, it takes only 1 second.

      It seems that the outer tests are not parallelly-processed until all inner tests are processed.

      Attachments

        Activity

          People

            tibordigana Tibor Digana
            miyajan Miyata Jumpei
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: