maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tibor Digana (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SUREFIRE-1207) A new JVM is forked even for tests not matching the "groups" tag when "reuseForks" is false
Date Mon, 14 Dec 2015 17:16:46 GMT

    [ https://issues.apache.org/jira/browse/SUREFIRE-1207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15055730#comment-15055730
] 

Tibor Digana edited comment on SUREFIRE-1207 at 12/14/15 5:15 PM:
------------------------------------------------------------------

I used Mockito. The mock frameworks record methods in static context.
I was facing memory leak in Mockito and tried to come over this issue by
reset(mock). It did not help me and therefore I use Java Proxy on interface.
I guess mock frameworks would interfere tests executed in parallel.
So I currently use mockito in the least invasive way and prefer testing
real implementations.

On Mon, Dec 14, 2015 at 10:43 AM, Michael Comerford (JIRA) <jira@apache.org>




was (Author: tibor17):
I used Mockito. The mock frameworks record methods in static context.
I was facing memory leak in Mockito and tried to come over this issue my
reset(mock). It did not help me and therefore I use Java Proxy on interface.
I guess mock frameworks would interfere tests executed in parallel.
So I currently use mockito in the least invasive way and prefer testing
real implementations.

On Mon, Dec 14, 2015 at 10:43 AM, Michael Comerford (JIRA) <jira@apache.org>



> A new JVM is forked even for tests not matching the "groups" tag when "reuseForks" is
false
> -------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1207
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1207
>             Project: Maven Surefire
>          Issue Type: Improvement
>    Affects Versions: 2.18.1
>            Reporter: Michael Comerford
>             Fix For: Backlog
>
>
> When the "groups" tag is used with "resuseForks" as false, a new fork is created for
every test, not just the one in the group tag. The tests which don't match the group aren't
ran, but a fork is still created and destroyed for every test, which is very inefficient.
> Example:
> {code:xml}
> <plugin>
>     <artifactId>maven-surefire-plugin</artifactId>
>     <configuration>
>         <skip>true</skip>
>     </configuration>
>     <executions>
>         <execution>
>             <id>default-tests</id>
>             <phase>test</phase>
>             <goals>
>                 <goal>test</goal>
>             </goals>
>             <configuration>
>                 <skip>false</skip>
>                 <excludedGroups>IsolatedTests</excludedGroups>
>             </configuration>
>         </execution>
>         <execution>
>             <id>isolatedTests</id>
>             <phase>test</phase>
>             <goals>
>                 <goal>test</goal>
>             </goals>
>             <configuration>
>                 <skip>false</skip>
>                 <groups>IsolatedTests</groups>
>                 <forkCount>1</forkCount>
>                 <reuseForks>false</reuseForks>
>             </configuration>
>         </execution>
>     </executions>
> </plugin>
> {code}
> The forking can be seen when running maven in debug mode: {{mvn test -X}} and searching
for the text "Forking command line"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message