Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Bug
-
2.22.2, 3.0.0-M4
-
None
-
None
Description
Up front, I don't know if this is a Maven Surefire bug, or something in Spring (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>
(Also reproduced with 3.0.0-M4)
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.