fix(run): count every test when JUnit runs them in parallel (#6377)

With JUnit's parallel concurrent mode, OpenIDEA's JUnit runner could report fewer tests than finished: the listener is called from several worker threads, Reporter's counters were plain ints incremented without a lock and PlatformRunner's start times a HashMap. The counting methods are synchronized now and the start times a ConcurrentHashMap. build.py --test runs a 4000-invocation parallel sample and expects the exact summary.

Closes #6334

Co-authored-by: audichuang <[email protected]>
Цей коміт міститься в:
audichuang authored and GitHub committed 2026-11-27 14:37:21 +08:00
1 джерело 2a26c82357
коміт e6cb7df653
5 files changed
+34 -8

No files matched your search

+16
Переглянути файл
@@ -0,0 +1,16 @@
package sample;
import static org.junit.jupiter.api.Assertions.fail;
import org.junit.jupiter.api.RepeatedTest;
/** Many tests finishing at once when JUnit runs them in parallel. */
class ParallelSampleTest {
@RepeatedTest(2000)
void passes() {}
@RepeatedTest(2000)
void fails() {
fail("no");
}
}