@@ -265,22 +265,17 @@ export const runTests: (request: TestRunRequest, option: IRunOption) => any = in
265265 if ( typeof error ?. message === 'string'
266266 && error . message . startsWith ( JUnitLaunchProtocol . MULTI_METHOD_LAUNCH_UNSUPPORTED_PREFIX )
267267 && testContext . testItems . length > 1 ) {
268- // Silent fallback for older Eclipse Java Language Server
269- // releases (predating eclipse.jdt.ui#2975): re-launch every
270- // selected method in its own JVM. From here on the cancel
271- // handler must defer to the per-item debug sessions, just
272- // as it would for a normal multi-group run.
268+ // Silent fallback for legacy JDT-LS (pre eclipse.jdt.ui#2975):
269+ // re-launch every selected method in its own JVM.
273270 delegatedToDebugger = true ;
274271 const itemsToRetry : TestItem [ ] = [ ...testContext . testItems ] ;
275272 for ( const item of itemsToRetry ) {
276273 if ( token . isCancellationRequested ) {
277274 break ;
278275 }
279- // Each per-item launch hands its progress to the debugger
280- // via __progressId, and the debugger calls done() when the
281- // session ends. The next iteration must therefore obtain a
282- // fresh progress reporter — mirroring the same isCancelled
283- // reset that the outer per-kind loop performs at line ~240.
276+ // Each per-item launch hands progress to the debugger via
277+ // __progressId; the debugger dones the reporter on session
278+ // end. Reset like the outer per-kind loop does (~line 240).
284279 if ( option . progressReporter ?. isCancelled ( ) ) {
285280 option . progressReporter = progressProvider ?. createProgressReporter ( option . isDebug ? 'Debug Tests' : 'Run Tests' ) ;
286281 }
@@ -682,11 +677,10 @@ export function mergeTestMethods(testItems: TestItem[]): TestItem[][] { // expor
682677 && ! ( [ ...methods ] . some ( ( m : TestItem ) => dataCache . get ( m ) ?. uniqueId ) ) ) {
683678 classMapping . set ( clazz . id , clazz ) ;
684679 } else {
685- // Methods restricted to a single invocation (uniqueId) must still run in their
686- // own launch since the underlying protocol carries at most one uniqueId per JVM.
687- // Every other method of the same class can share one launch so that
688- // @BeforeAll / @AfterAll and any cached fixture (e.g. Spring ApplicationContext)
689- // are reused across the selection. See issue #1836.
680+ // uniqueId methods must run alone (the protocol carries at most one
681+ // uniqueId per JVM); the rest can share a JVM so @BeforeAll/@AfterAll
682+ // and cached fixtures (e.g. Spring ApplicationContext) are reused.
683+ // See issue #1836.
690684 const groupable : TestItem [ ] = [ ] ;
691685 for ( const method of methods . values ( ) ) {
692686 if ( dataCache . get ( method ) ?. uniqueId ) {
@@ -753,14 +747,9 @@ function getRunnerByContext(testContext: IRunTestContext): BaseRunner | undefine
753747}
754748
755749/**
756- * Run a single test item through its own setup → resolve → run → tearDown
757- * cycle. Used as a silent fallback when the bundled JDT-LS does not yet
758- * understand the {@code Class:method} multi-method launch protocol
759- * (eclipse.jdt.ui#2975) — every selected method is re-launched in its own JVM,
760- * matching the pre-batching behaviour. Errors during the fallback are
761- * surfaced per-item so unrelated failures (e.g. compilation errors) are still
762- * reported to the user; the multi-method marker itself is filtered out so the
763- * scary "requires a newer..." text never reaches the popup.
750+ * Run a single test item through its own setup → resolve → run → tearDown cycle.
751+ * Used as the silent fallback when the bundled JDT-LS lacks the
752+ * {@code Class:method} multi-method protocol (eclipse.jdt.ui#2975).
764753 */
765754async function runItemInIsolatedLaunch (
766755 item : TestItem ,
@@ -787,9 +776,7 @@ async function runItemInIsolatedLaunch(
787776 await runner . run ( resolvedConfiguration , token , option . progressReporter ) ;
788777 } catch ( error ) {
789778 const rawMessage : string = error ?. message || 'Failed to run tests.' ;
790- // Strip the internal marker if it ever bubbles up here (e.g. the user
791- // somehow ends up with a single-method batch that still hits the
792- // capability gate) so the popup stays user-readable.
779+ // Strip the internal marker if it ever bubbles up here so the popup stays user-readable.
793780 const message : string = rawMessage . startsWith ( JUnitLaunchProtocol . MULTI_METHOD_LAUNCH_UNSUPPORTED_PREFIX )
794781 ? rawMessage . substring ( JUnitLaunchProtocol . MULTI_METHOD_LAUNCH_UNSUPPORTED_PREFIX . length )
795782 : rawMessage ;
0 commit comments