Gareth Daniel Smith created SUREFIRE-1725:
---------------------------------------------

             Summary: Surefire in JUnit Vintage mode distributes tests very 
unevenly between forks, causing poor parallelism
                 Key: SUREFIRE-1725
                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1725
             Project: Maven Surefire
          Issue Type: Bug
          Components: Junit 4.x support, JUnit 5.x support, Maven Surefire 
Plugin
    Affects Versions: 3.0.0-M3
            Reporter: Gareth Daniel Smith
         Attachments: junit-5-vintage-bug.zip

To reproduce this issue, please run the attached test case using {{mvn clean 
verify}}

You will see output similar to the following:
{code:java}
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running My7Test
Test in process 32569
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.017 s 
- in My7Test
[INFO] Running My9Test
Test in process 32569
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.983 s 
- in My9Test
[INFO] Running My4Test
Test in process 32569
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.998 s 
- in My4Test
[INFO] Running My8Test
Test in process 32569
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.999 s 
- in My8Test
[INFO] Running My6Test
Test in process 32569
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.001 s 
- in My6Test
[INFO] Running My1Test
Test in process 32569
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1 s - in 
My1Test
[INFO] Running My5Test
Test in process 32569
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.999 s 
- in My5Test
[INFO] Running My3Test
Test in process 32569
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.997 s 
- in My3Test
[INFO] Running My2Test
Test in process 32569
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1 s - in 
My2Test
[INFO] Running My0Test
Test in process 32569
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.999 s 
- in My0Test
{code}
Notice how all 10 tests are being run on the same process. This is wrong 
because there should be 5 forks - and the tests should be evenly distributed 
between them.

If Junit4 is used instead of Junit5+vintage (see the commented dependency in 
pom.xml) then this issue does not occur (probably because Surefire uses a 
different code path in that case).

Please note that this issue was originally logged against Junit 
([https://github.com/junit-team/junit5/issues/2114)] - but they suggested the 
problem lies within surefire.

Thanks for any help!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to