Comments (4)
@mas-chen Please provide a complete reproducer, i.e. including the project's POM etc.
from junit5.
Sure here is my reproducer test. https://github.com/mas-chen/flink-connector-kafka/blob/b93fc74029a7c88c61ed04dc820fc9f59d554448/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/MasonTest.java
Surefire is configured as part of an external project (see parent pom in the root pom)
from junit5.
Thanks!
I debugged the execution. In this case, Maven Surefire sends three separate discovery/execution requests (order is unclear to me, might be dependent on file system):
- ClassSelector [className = 'org.apache.flink.streaming.connectors.kafka.MasonTest$MasonTest1']
- ClassSelector [className = 'org.apache.flink.streaming.connectors.kafka.MasonTest']
- ClassSelector [className = 'org.apache.flink.streaming.connectors.kafka.MasonTest$MasonTest2']
(1) will cause MasonTest1
to be executed, (3) will cause MasonTest2
to be executed, while (2) will cause both to be executed. That explains the double execution. IIRC Surefire scans the test classes dir (target/test-classes
) for classes matching MasonTest*
(supplied via -Dtest
). Thus it finds MasonTest.class
but also MasonTest$MasonTest1.class
and MasonTest$MasonTest2.class
. Interestingly, this does not happen when running all tests (without passing -Dtest
). In any case, I think Surefire should filter out nested classes when the enclosing class passes the filter to avoid this. Please raise an issue with the Maven Surefire project.
from junit5.
@marcphilipp thanks for the pointers, this helps a lot! I'll try an exclude filter on the nested classes
from junit5.
Related Issues (20)
- Ability to inject extensions via Launcher to simplify testing HOT 7
- @ParameterizedTest is not recognized by the method selector using Junit Platform Console Standalone HOT 3
- Disable creation of Log4J JMX beans in Gradle test conventions HOT 2
- Request to add copyright information to pom.xml HOT 5
- Adopt some asserts from assertj HOT 3
- Update from testng 7.9.0 to 7.10.0 break maven build with junit5 HOT 2
- Create 5.11 upgrade guide wiki page HOT 2
- Improving the IDE ergonomics for individual dynamic test re-run HOT 3
- ClassOrderer$Random with seed does not work HOT 3
- Extend `JRE` enum to support Java 24
- Inject into test case from launcher HOT 11
- Update open-test-reporting to 0.1.0-M2
- Document exception handling for failed assumptions
- Discovered multiple competing ParameterResolvers - JUnit5 + Guice HOT 1
- Console launcher should support `--version` HOT 5
- @ParameterizedTest @ArgumentSouce should accept Arguments[] and Stream<Arguments> HOT 7
- `MalformedParametersException` on JDK 8 for synthetic bridge methods in Jupiter classes (5.11.0-M1) HOT 5
- `@CsvSource` drops backslash character from input HOT 3
- Improve `parallel.mode` chart in User Guide HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from junit5.