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] [Commented] (SUREFIRE-1373) Tests annotated with @NotThreadSafe are not executed in isolation
Date Sat, 09 Sep 2017 08:35:02 GMT

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

Tibor Digana commented on SUREFIRE-1373:
----------------------------------------

[~apache-bugzilla@sebastian-kirsch.org]
[~sebastiankirsch]
[~tuk]
I checked the code again and it is correct. I want to say that now I do not see error in the
code.
Therefore I would like to ask you to do one of these two things or both:
 * write a {{pom.xml}} and simple sources to reproduce this issue
 * write unit test in our existing test class [ParallelComputerBuilderTest|https://github.com/apache/maven-surefire/blob/master/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/ParallelComputerBuilderTest.java]
and print in console expected test is being run after {{sleep()}} with different delays in
each method. 

> Tests annotated with @NotThreadSafe are not executed in isolation
> -----------------------------------------------------------------
>
>                 Key: SUREFIRE-1373
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1373
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin
>    Affects Versions: 2.20
>            Reporter: Sebastian Kirsch
>            Assignee: Tibor Digana
>             Fix For: 2.20.2
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> The [surefire documentation|http://maven.apache.org/components/surefire/maven-failsafe-plugin/examples/fork-options-and-parallel-execution.html]
states that 
> bq. you can apply the JCIP annotation @net.jcip.annotations.NotThreadSafe on the Java
class of JUnit test (pure test class, Suite, Parameterized, etc.) in order to execute it in
single Thread instance. The Thread has name maven-surefire-plugin@NotThreadSafe and it is
executed at the end of the test run.
> However, the thread is run in parallel to the other tests being executed, which contradicts
the documentation and defeats the purpose of running tests sequentially in a single thread.
> See https://github.com/sebastiankirsch/surefire-nonthreadsafe for a test case.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message