Giter Site home page Giter Site logo

Comments (4)

marcphilipp avatar marcphilipp commented on July 17, 2024

@mas-chen Please provide a complete reproducer, i.e. including the project's POM etc.

from junit5.

mas-chen avatar mas-chen commented on July 17, 2024

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.

marcphilipp avatar marcphilipp commented on July 17, 2024

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):

  1. ClassSelector [className = 'org.apache.flink.streaming.connectors.kafka.MasonTest$MasonTest1']
  2. ClassSelector [className = 'org.apache.flink.streaming.connectors.kafka.MasonTest']
  3. 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.

mas-chen avatar mas-chen commented on July 17, 2024

@marcphilipp thanks for the pointers, this helps a lot! I'll try an exclude filter on the nested classes

from junit5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.