This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven.git
The following commit(s) were added to refs/heads/master by this push:
new 5b2a619901 test: drop flaky parallel-worker assertion in
MavenITmng8445DiDumpTest (#14035)
5b2a619901 is described below
commit 5b2a61990111efc7a7ad2dcea5be5626146ef5e4
Author: Guillaume Nodet <[email protected]>
AuthorDate: Wed Nov 18 00:38:28 2026 +0100
test: drop flaky parallel-worker assertion in MavenITmng8445DiDumpTest
(#14035)
The test asserted that at least two distinct thread IDs were observed
when running three modules with -T 8. With a fast validate-phase goal
and a small reactor, the thread-pool scheduler can legitimately assign
all three modules to the same thread sequentially, making the assertion
non-deterministic.
The parallel BuilderCases are still exercised to verify that the DI
dump mechanism is safe under concurrent access; the per-module count
check (assertEquals(MODULE_PATHS.size(), workerIds.size())) is kept.
Only the probabilistic multi-thread assertion is removed.
---
.../test/java/org/apache/maven/it/MavenITmng8445DiDumpTest.java | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git
a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8445DiDumpTest.java
b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8445DiDumpTest.java
index 3676c8be71..9e7ea91c23 100644
---
a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8445DiDumpTest.java
+++
b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8445DiDumpTest.java
@@ -24,8 +24,8 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.stream.Stream;
import java.util.regex.Pattern;
+import java.util.stream.Stream;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.TestFactory;
@@ -100,11 +100,8 @@ private void verifyDump(Path project, BuilderCase builder,
String nativeMode, bo
workerIds.addAll(verifier.loadLines(module +
"target/di-check.txt"));
}
assertEquals(MODULE_PATHS.size(), workerIds.size());
- if (builder.parallel()) {
- assertTrue(
- workerIds.subList(1,
workerIds.size()).stream().distinct().count() > 1,
- "Expected more than one Maven worker");
- }
+ // Note: not asserting distinct worker count — with fast
validate-phase builds, all modules
+ // may legitimately complete on the same thread even with -T N.
List<String> nativeRows = new ArrayList<>();
int dumps = collectNativeRows(lines, nativeRows);
List<String> stdoutLines = verifier.getStdout().lines().toList();