apache / apache/maven-surefire

NoSuchFileException when executing tests

Open
#3,199 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
461
Forks
588
Avg merge
1d 8h
Merged PRs (30d)
19

Description

### Affected version

3.5.4

### Bug description

Hello,
We are getting the error below in about 20% of our builds.
We don't know what triggers it.
Our builds are executed in docker containers so they should be pretty consistent...
Any ideas of the root cause ?
We are using java 21, maven 3.9.9 and surefire 3.5.4.
Thanks in advance for any help you can provide !

> [2025-10-02T16:15:31.465Z] [INFO] ----------------------< com.swift.amh:framework >-----------------------
[2025-10-02T16:15:31.465Z] [INFO] Building framework 6.0.0-SNAPSHOT [5/260]
[2025-10-02T16:15:31.465Z] [INFO] from framework/pom.xml
[2025-10-02T16:15:31.465Z] [INFO] --------------------------------[ jar ]---------------------------------
[2025-10-02T16:15:31.465Z] [INFO]
[2025-10-02T16:15:31.465Z] [INFO] --- jacoco:0.8.12:prepare-agent (prepare-unit_reporting) @ framework ---
[2025-10-02T16:15:31.465Z] [INFO] surefire.jacoco.args set to -javaagent:/home/jenkins/agent/workspace/AMH_amh-build_PR-8424/repository/org/jacoco/org.jacoco.agent/0.8.12/org.jacoco.agent-0.8.12-runtime.jar=destfile=/home/jenkins/agent/workspace/AMH_amh-build_PR-8424/framework/target/jacoco-output/jacoco-unit-test.exec,excludes=**/generated*/**:**/*.jar
[2025-10-02T16:15:31.465Z] [INFO]
[2025-10-02T16:15:31.465Z] [INFO] --- surefire:3.5.4:test (default-cli) @ framework ---
[2025-10-02T16:15:31.465Z] [INFO] Surefire report directory: /home/jenkins/agent/workspace/AMH_amh-build_PR-8424/framework/target/surefire-reports
[2025-10-02T16:15:31.465Z] [INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
[2025-10-02T16:15:31.465Z] [INFO]
[2025-10-02T16:15:31.465Z] [INFO] -------------------------------------------------------
[2025-10-02T16:15:31.465Z] [INFO] T E S T S
[2025-10-02T16:15:31.465Z] [INFO] -------------------------------------------------------
[2025-10-02T16:15:31.722Z] Error: An unexpected error occurred while trying to open file /home/jenkins/agent/workspace/AMH_amh-build_PR-8424/framework/target/surefire/surefirebooter-20251002161531453_32.jar
[2025-10-02T16:15:31.722Z] java.nio.file.NoSuchFileException: /home/jenkins/agent/workspace/AMH_amh-build_PR-8424/framework/target/surefire/surefirebooter-20251002161531453_32.jar
[2025-10-02T16:15:31.722Z] at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
[2025-10-02T16:15:31.722Z] at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
[2025-10-02T16:15:31.722Z] at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
[2025-10-02T16:15:31.722Z] at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
[2025-10-02T16:15:31.722Z] at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:171)
[2025-10-02T16:15:31.722Z] at java.base/sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
[2025-10-02T16:15:31.722Z] at java.base/java.nio.file.Files.readAttributes(Files.java:1853)
[2025-10-02T16:15:31.722Z] at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1445)
[2025-10-02T16:15:31.722Z] at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:724)
[2025-10-02T16:15:31.722Z] at java.base/java.util.zip.ZipFile.(ZipFile.java:251)
[2025-10-02T16:15:31.722Z] at java.base/java.util.zip.ZipFile.(ZipFile.java:180)
[2025-10-02T16:15:31.722Z] at java.base/java.util.jar.JarFile.(JarFile.java:345)
[2025-10-02T16:15:31.722Z] at java.base/java.util.jar.JarFile.(JarFile.java:316)
[2025-10-02T16:15:31.722Z] at java.base/java.util.jar.JarFile.(JarFile.java:255)
[2025-10-02T16:15:31.722Z] at java.base/sun.launcher.LauncherHelper.getMainClassFromJar(LauncherHelper.java:558)
[2025-10-02T16:15:31.722Z] at java.base/sun.launcher.LauncherHelper.loadMainClass(LauncherHelper.java:784)
[2025-10-02T16:15:31.722Z] at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:692)
[2025-10-02T16:15:31.979Z] [INFO]
[2025-10-02T16:15:31.979Z] [INFO] Results:
[2025-10-02T16:15:31.979Z] [INFO]
[2025-10-02T16:15:31.979Z] [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the intermittent failure with Java 21, Maven 3.9.9, Surefire 3.5.4, and the Docker-based build described in the issue. Trace how the surefirebooter JAR is created and launched, focusing on the reported target/surefire path. Done means identifying the trigger, reproducing it reliably, and preventing the NoSuchFileException with coverage for the failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
build-system, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.