ASSERT-KTH / ASSERT-KTH/flacoco

Occurence of java.lang.RuntimeException: java.nio.file.NoSuchFileException: `CoveredTestResultPerTest.dat`

Open
#121 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
38
Forks
15
PR merge metrics
No merged PRs in 30d

Description

I have encountered a new exception as follows when I use flacoco to localize an NPE bug in [https://github.com/mybatis/mybatis-3/commit/5a26fd106832fc70c08d0a1597a1999798236581](https://github.com/mybatis/mybatis-3/commit/5a26fd106832fc70c08d0a1597a1999798236581):

```
[543] INFO EntryPoint - Path to runner Classes: /home/apr/tools/flacoco/target/flacoco-1.0.1-SNAPSHOT-jar-with-dependencies.jar
[551] INFO EntryPoint - /home/apr/tools/flacoco/target/flacoco-1.0.1-SNAPSHOT-jar-with-dependencies.jar
[551] INFO EntryPoint - /home/apr/tools/flacoco/target/flacoco-1.0.1-SNAPSHOT-jar-with-dependencies.jar
[551] INFO EntryPoint - /home/apr/tools/flacoco/target/flacoco-1.0.1-SNAPSHOT-jar-with-dependencies.jar
[551] INFO EntryPoint - /home/apr/tools/flacoco/target/flacoco-1.0.1-SNAPSHOT-jar-with-dependencies.jar
[553] INFO EntryPoint - /home/apr/tools/flacoco/target/flacoco-1.0.1-SNAPSHOT-jar-with-dependencies.jar
[553] INFO EntryPoint - /home/apr/tools/flacoco/target/flacoco-1.0.1-SNAPSHOT-jar-with-dependencies.jar
[553] INFO EntryPoint - /home/apr/tools/flacoco/target/flacoco-1.0.1-SNAPSHOT-jar-with-dependencies.jar
[553] INFO EntryPoint - /home/apr/tools/flacoco/target/flacoco-1.0.1-SNAPSHOT-jar-with-dependencies.jar
[553] INFO EntryPoint - /home/apr/tools/flacoco/target/flacoco-1.0.1-SNAPSHOT-jar-with-dependencies.jar
[553] INFO EntryPoint - /home/apr/tools/flacoco/target/flacoco-1.0.1-SNAPSHOT-jar-with-dependencies.jar
[553] INFO EntryPoint - /home/apr/tools/flacoco/target/flacoco-1.0.1-SNAPSHOT-jar-with-dependencies.jar
java.lang.RuntimeException: java.nio.file.NoSuchFileException: /mnt/data/tests/mybatis/first_bug/mybatis-3-tbar/./target/CoveredTestResultPerTest.dat
at eu.stamp_project.testrunner.listener.utils.ListenerUtils.loadFromMemoryMappedFile(ListenerUtils.java:83)
at eu.stamp_project.testrunner.listener.impl.OnlineCoveredTestResultPerTestMethodImpl.load(OnlineCoveredTestResultPerTestMethodImpl.java:169)
at eu.stamp_project.testrunner.EntryPoint.runOnlineCoveredTestResultPerTestMethods(EntryPoint.java:664)
at fr.spoonlabs.flacoco.core.coverage.framework.JUnit5Strategy.execute(JUnit5Strategy.java:30)
at fr.spoonlabs.flacoco.core.coverage.CoverageRunner.getCoverageMatrix(CoverageRunner.java:47)
at fr.spoonlabs.flacoco.localization.spectrum.SpectrumRunner.computeCoverageMatrix(SpectrumRunner.java:56)
at fr.spoonlabs.flacoco.localization.spectrum.SpectrumRunner.run(SpectrumRunner.java:32)
at fr.spoonlabs.flacoco.api.Flacoco.run(Flacoco.java:31)
at fr.spoonlabs.flacoco.cli.FlacocoMain.call(FlacocoMain.java:157)
at fr.spoonlabs.flacoco.cli.FlacocoMain.call(FlacocoMain.java:27)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2078)
at fr.spoonlabs.flacoco.cli.FlacocoMain.main(FlacocoMain.java:148)
Caused by: java.nio.file.NoSuchFileException: /mnt/data/tests/mybatis/first_bug/mybatis-3-tbar/./target/CoveredTestResultPerTest.dat
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:177)
at java.nio.channels.FileChannel.open(FileChannel.java:287)
at java.nio.channels.FileChannel.open(FileChannel.java:335)
at eu.stamp_project.testrunner.listener.utils.ListenerUtils.loadFromMemoryMappedFile(ListenerUtils.java:67)
... 17 more
```

My script is:
```
flacocoPath=/home/apr/tools/flacoco/target/flacoco-1.0.1-SNAPSHOT-jar-with-dependencies.jar

curDir="$(cd $(dirname $0); pwd)"
tool=tbar
bug_dir="$curDir/mybatis-3-${tool}"

src_java=${bug_dir}/"src/main/java/"
bin_java=${bug_dir}/"target/classes/"
bin_test=${bug_dir}/"target/test-classes/"
classpath=""

cd $bug_dir;
mvn dependency:copy-dependencies
cd -;

for file in ${bug_dir}/target/dependency/*
do
if [[ $file == *".jar" ]]; then
classpath="${classpath}:${file}"
fi
done

cd $bug_dir;
echo -e "java -jar $flacocoPath --projectpath $bug_dir --classpath ${bin_java}:${bin_test}$classpath \n\n"

java -jar $flacocoPath --projectpath $bug_dir --classpath ${bin_java}:${bin_test}$classpath
```

It would be sincerely appreciated if any advice could be given. Thank you!

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the shown Maven setup and java -jar command against the MyBatis checkout. Trace the stack from JUnit5Strategy and CoverageRunner through EntryPoint.runOnlineCoveredTestResultPerTestMethods to ListenerUtils.loadFromMemoryMappedFile, and determine why target/CoveredTestResultPerTest.dat is absent. Done means the failure is explained and the invocation either completes or gives an actionable setup error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.