Carsten Otto created SUREFIRE-1761:
--------------------------------------

             Summary: Test failure with runOrder / class hierarchy / TestNG / 
@DirtiesContext
                 Key: SUREFIRE-1761
                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1761
             Project: Maven Surefire
          Issue Type: Bug
            Reporter: Carsten Otto


 

{{Up front, I don't know if this is a Maven Surefire bug, or something in 
Spring }}(s{{See 
[https://github.com/spring-projects/spring-framework/issues/24685])}}

{{}}<spring.version>5.2.4.RELEASE</spring.version> 
<testng.version>7.1.0</testng.version> 
<maven.compiler.target>1.8</maven.compiler.target> 
<maven.compiler.source>1.8</maven.compiler.source> 
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>

To reproduce: [https://github.com/C-Otto/dirtiescontext]

I have a Spring, Maven, Java 8, TestNG setup where one test uses 
{{@DirtiesContext}}. In this VERY specific setup the test fails when I use 
{{mvn test}}. This seems to be related to the class names and the order in 
which tests are run.

Notice that the class {{AbstractClassSomeUnrelatedTest}} does not serve any 
purpose, but has the same name prefix as the {{abstract}} test class. Changing 
the name to something else fixes the problem.



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

Reply via email to