[ 
https://jira.codehaus.org/browse/SUREFIRE-747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kristian Rosenvold closed SUREFIRE-747.
---------------------------------------

    Resolution: Fixed

I'm closing this issue, since I created a separate issue SUREFIRE-797 for 
parallel not working with suite, which may actually be a JUnit issue. The issue 
of reported run-time has been fixed in other issues. 

When reporting issues, please bear in mind that someone will be fixing these 
issues, and the more un-related gripes you attach to each issue, the harder it 
becomes to actually resolve the issue. So if you report issues, generally try 
to report one distinct issue per problem.

Thank you for the report, I'd be very interested to hear if you can get 
"parallel" to work with a suite using just regular junit.

> Parallel method execution skips Tests
> -------------------------------------
>
>                 Key: SUREFIRE-747
>                 URL: https://jira.codehaus.org/browse/SUREFIRE-747
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.7+ (parallel) support
>    Affects Versions: 2.8, 2.8.1
>            Reporter: Gili
>            Assignee: Kristian Rosenvold
>
> Here is a simple testcase.
> POM file:
> {code}
>                       <plugin>
>                               <artifactId>maven-surefire-plugin</artifactId>
>                               <version>2.8.2-SNAPSHOT</version>
>                               <configuration>
>                                       <includes>
>                                               
> <include>**/TestSuite.java</include>
>                                       </includes>
>                                       <parallel>methods</parallel>
>                               </configuration>
>                       </plugin>
>               </plugins>
> {code}
> TestSuite.java
> {code}
> import org.junit.runner.RunWith;
> import org.junit.runners.Suite;
> @RunWith(Suite.class)
> @Suite.SuiteClasses(
> {
>       ParallelTest.class,
>       ParallelTest2.class
> })
> public class TestSuite
> {
> }
> {code}
> ParallelTest.java
> {code}
> public class ParallelTest
> {
>       public ParallelTest()
>       {
>               System.out.println("ParallelTest.constructor");
>       }
>       
>       @Before
>       public void setUp()
>       {
>               System.out.println("ParallelTest.setUp");
>       }
>       @After
>       public void tearDown()
>       {
>               System.out.println("ParallelTest.tearDown");
>       }
>       @Test
>       public void first() throws InterruptedException
>       {
>               System.out.println("begin ParallelTest.first");
>               Thread.sleep(1000);
>               System.out.println("end ParallelTest.first");
>       }
>       @Test
>       public void second() throws InterruptedException
>       {
>               System.out.println("begin ParallelTest.second");
>               Thread.sleep(1000);
>               System.out.println("end ParallelTest.second");
>       }
>       @Test
>       public void third() throws InterruptedException
>       {
>               System.out.println("begin ParallelTest.third");
>               Thread.sleep(1000);
>               System.out.println("end ParallelTest.third");
>       }
> }
> {code}
> ParallelTest2.java is identical except that log output contains ParallelTest2 
> instead of ParallelTest.
> Actual Output:
> {quote}
> Concurrency config is parallel='methods', perCoreThreadCount=true, 
> threadCount=2, useUnlimitedThreads=false
> Running com.holdmyspot.health.server.ParallelTest
> ParallelTest.constructor
> ParallelTest.setUp
> begin ParallelTest.first
> end ParallelTest.first
> ParallelTest.tearDown
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.014 sec
> Running com.holdmyspot.health.server.ParallelTest2
> ParallelTest2.constructor
> ParallelTest2.setUp
> begin ParallelTest2.first
> end ParallelTest2.first
> ParallelTest2.tearDown
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.014 sec
> Results :
> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
> {quote}
> Problem: methods second() and third() are never run for either ParallelTest 
> or ParallelTest2.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to