Community
Participate
Working Groups
Eclipse calls Launcher#discover first (for all discovery requests) to collect the discovered test plans which are used to count the total number of tests and create the test tree. After that, Launcher#execute is called which notifies the corresponding TestExecutionListeners and the test tree is updated. The implementation is based on the Javadoc of Launcher: Clients of this interface may optionally call discover prior to execute in order to inspect the TestPlan before executing it. This sequence of steps in Eclipse is common for JUnit 4 also.
Based on JUnit 5 issue https://github.com/junit-team/junit5/issues/1695, Launcher#discover should be avoided as Launcher#execute performs discovery once again which can result in performance problems. The proposed solution on the GitHub issue doesn't look straightforward for Eclipse due to its current implementation. It would have been easier to have the Launcher#execute(TestPlan) method with a disclaimer to the clients to not modify the TestPlan before calling #execute(TestPlan).
I will investigate further and update the bug.
(In reply to Noopur Gupta from comment #2) > I will investigate further and update the bug. Provided feedback via https://github.com/junit-team/junit5/issues/1695#issuecomment-448989093.
New Gerrit change created: https://git.eclipse.org/r/137000
Gerrit change https://git.eclipse.org/r/137000 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=83c18fb32197214664264794b344e12897eea42c