slachiewicz opened a new issue, #13716:
URL: https://github.com/apache/maven/issues/13716

   ### Affected version
   
   4.1.0-SNAPSHOT (master) and 4.0.x, on Windows
   
   ### Bug description
   
   `MavenITmng4559MultipleJvmArgsTest.testMultipleJvmArgs` fails intermittently 
on Windows CI:
   
   ```
   org.opentest4j.AssertionFailedError: expected: <value1> but was: 
<${test.prop1}>
        at 
org.apache.maven.it.MavenITmng4559MultipleJvmArgsTest.testMultipleJvmArgs(MavenITmng4559MultipleJvmArgsTest.java:56)
   ```
   
   It caused three of the four failed `master` builds between 2026-10-22 and 
2026-10-23, each time on Windows with a different JDK:
   
   - https://github.com/apache/maven/actions/runs/39937260686/job/120364064513 
(JDK 17)
   - https://github.com/apache/maven/actions/runs/39924795941/job/120323206675 
(JDK 27)
   - https://github.com/apache/maven/actions/runs/39794831998/job/119883402089 
(JDK 25)
   
   The `-Dtest.prop1=value1` from `.mvn/jvm.config` never reached the JVM.
   
   ### Cause
   
   `mvn.cmd` names the file that holds the parsed `jvm.config` arguments 
`%TEMP%\mvn-jvm-config-%RANDOM%-%RANDOM%.txt`. `cmd.exe` seeds `%RANDOM%` from 
the clock once per process, at one-second resolution, so every `mvn.cmd` 
started in the same second picks the same name. The integration tests run with 
`its.forkCount` 0.75C, so several Maven processes start together.
   
   Since #13652 the JVM reads that file as an `@argfile` and `mvn.cmd` deletes 
it only after the JVM exits, so the file lives for the whole build instead of a 
few milliseconds. Two builds that start in the same second write the same file: 
one runs with the other's JVM arguments, or finds the file already deleted. The 
fast `mvn -v` path names its temp file the same way. The `mvn` shell script 
uses `mktemp` and is not affected.
   
   ### Fix
   
   Create each temp file inside a directory made with `mkdir`, which fails when 
the name is taken, and retry with the next `%RANDOM%` values.
   


-- 
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]

Reply via email to