gnodet commented on PR #3352: URL: https://github.com/apache/maven-surefire/pull/3352#issuecomment-5075323370
I force-pushed with a rebased commit on top of current master that addresses all three failure categories from the CI runs: ### 1. Matrix exclusion fix The original exclude used `"maven": "4"` but the shared workflow expands the matrix with the exact version string `"4.0.0-rc-5"`, so the JDK 11 cells were never excluded. Fixed to `"maven": "4.0.0-rc-5"`. The JDK 8 exclude was also removed since the shared workflow [already auto-excludes JDK 8](https://github.com/apache/maven-gh-actions-shared/blob/v4/.github/workflows/maven-verify.yml) when `maven4-enabled=true`. ### 2. IT failures — force forked mode for Maven 4 All integration tests failed because `maven-verifier:2.0.0-M1` uses reflection to call `MavenCling.doMain(String[], String, PrintStream, PrintStream)` in embedded mode, but Maven 4 rc-5 changed this method signature. The fix adds an `isMaven4()` detection in `MavenLauncher` that checks for `maven-cling-*.jar` in `$MAVEN_HOME/lib/` and forces `forkJvm=true`, bypassing the broken reflection entirely. This is a **short-term workaround**. The long-term fix is to migrate from `maven-verifier` (which is [being deprecated](https://github.com/apache/maven-verifier/issues/186)) to [maven-executor](https://github.com/apache/maven-executor) (`org.apache.maven.executor:maven-executor:1.0.0`), which natively supports both Maven 3.x and 4.x. ### 3. CountdownCloseable race condition (bonus fix) `CountdownCloseable.awaitClosed()` used `if` instead of `while` to guard `Object.wait()`, making it vulnerable to spurious wakeups per the JLS. This is a pre-existing bug that could explain the intermittent `CommandlineExecutorTest` failures reported on Windows — the test itself passes fine in CI on all platforms with both Maven 3 and 4. -- 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]
