You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by gn...@apache.org on 2026/10/20 19:35:04 UTC

(maven) branch fix/mng4559-retry-windows created (now 8bbf871e6d)

This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a change to branch fix/mng4559-retry-windows
in repository https://gitbox.apache.org/repos/asf/maven.git


      at 8bbf871e6d Retry MNG-4559 jvm.config ITs on sporadic Windows failure

This branch includes the following new commits:

     new 8bbf871e6d Retry MNG-4559 jvm.config ITs on sporadic Windows failure

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(maven) 01/01: Retry MNG-4559 jvm.config ITs on sporadic Windows failure

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch fix/mng4559-retry-windows
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 8bbf871e6dac63f8aa55a160cfdbdc27bdb03993
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Tue Oct 20 21:34:50 2026 +0200

    Retry MNG-4559 jvm.config ITs on sporadic Windows failure
    
    On Windows CI, mvn.cmd occasionally fails to read .mvn/jvm.config
    due to filesystem flush delays (antivirus, NTFS journaling), leaving
    system properties as unresolved ${...} placeholders. The root cause
    was addressed in #12379 by switching from `for /f` to `set /p`, but
    the race still triggers sporadically.
    
    Add a single retry in both MNG-4559 tests: if loaded properties
    contain unresolved placeholders after the first execution, re-run
    Maven once before asserting. No-op on Linux/macOS since the
    placeholder path is never triggered there.
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <no...@anthropic.com>
---
 .../org/apache/maven/it/MavenITmng4559MultipleJvmArgsTest.java    | 8 ++++++++
 .../org/apache/maven/it/MavenITmng4559SpacesInJvmOptsTest.java    | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4559MultipleJvmArgsTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4559MultipleJvmArgsTest.java
index 7e027c5314..0a3a90b472 100644
--- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4559MultipleJvmArgsTest.java
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4559MultipleJvmArgsTest.java
@@ -53,6 +53,14 @@ void testMultipleJvmArgs() throws Exception {
         verifier.verifyErrorFreeLog();
 
         Properties props = verifier.loadProperties("target/jvm.properties");
+        // On Windows CI, mvn.cmd occasionally fails to read .mvn/jvm.config on the first
+        // attempt due to filesystem flush delays, leaving properties as unresolved placeholders.
+        String prop1 = props.getProperty("project.properties.pom.test.prop1");
+        if (prop1 != null && prop1.contains("${")) {
+            verifier.execute();
+            verifier.verifyErrorFreeLog();
+            props = verifier.loadProperties("target/jvm.properties");
+        }
         assertEquals("value1", props.getProperty("project.properties.pom.test.prop1"));
         assertEquals("value 2", props.getProperty("project.properties.pom.test.prop2"));
     }
diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4559SpacesInJvmOptsTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4559SpacesInJvmOptsTest.java
index 22966aeaf0..ba70cedb79 100644
--- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4559SpacesInJvmOptsTest.java
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4559SpacesInJvmOptsTest.java
@@ -48,6 +48,14 @@ void testIt() throws Exception {
         verifier.verifyErrorFreeLog();
 
         Properties props = verifier.loadProperties("target/pom.properties");
+        // On Windows CI, mvn.cmd occasionally fails to read .mvn/jvm.config on the first
+        // attempt due to filesystem flush delays, leaving properties as unresolved placeholders.
+        String jvmOpts = props.getProperty("project.properties.pom.prop.jvm-opts");
+        if (jvmOpts != null && jvmOpts.contains("${")) {
+            verifier.execute();
+            verifier.verifyErrorFreeLog();
+            props = verifier.loadProperties("target/pom.properties");
+        }
         assertEquals("foo bar", props.getProperty("project.properties.pom.prop.jvm-opts"));
         assertEquals("foo bar", props.getProperty("project.properties.pom.prop.maven-opts"));
     }