olamy commented on PR #3470: URL: https://github.com/apache/maven-surefire/pull/3470#issuecomment-6096156347
Thanks for testing! In your case, 3 is currently expected: the testng-engine discovers tests by running TestNG in dry-run mode, which notifies ISuiteListeners, and the JUnit Platform always discovers before executing. (see comment here https://github.com/apache/maven-surefire/issues/3462#issuecomment-5627432284 and javadoc here https://github.com/junit-team/testng-engine/blob/78e75694529cca30bb741d4363c318ecaa2058d5/src/main/java/org/junit/support/testng/engine/TestNGTestEngine.java#L82-L89 ) So 1 isn't reachable from Surefire alone. Surefire still discovers once more than it needs to during the class scan, though, and if possible, I'll look at getting that down to 2. In the meantime, your listener can skip the dry runs with if (Boolean.getBoolean("testng.mode.dryrun")) return; and you'll get exactly one call. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
