Skip to content

[ Bug ] Windows JUnit temporary directory (org.junit.jupiter.api.io.TempDir) bug causes tests failure #38

@ideas-into-software

Description

@ideas-into-software

Running FeatureLauncherImplTest test on Windows results in failure due to issues with Junit temporary directory (org.junit.jupiter.api.io.TempDir) - stack traces included below.


(...)

[ERROR] Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.539 s <<< FAILURE! -- in com.kentyou.featurelauncher.impl.FeatureLauncherImplTest
[ERROR] com.kentyou.featurelauncher.impl.FeatureLauncherImplTest.testLaunchFeatureWithConfigWithDefaultFramework -- Time elapsed: 2.265 s <<< ERROR!
org.junit.platform.commons.JUnitException: Failed to close extension context
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.io.IOException: Failed to delete temp directory C:\Users\Uzivatel\AppData\Local\Temp\junit-16411345319734003674. The following paths could not be deleted (see suppressed exceptions for details): <root>, bundle7, bundle7\version0.0, bundle7\version0.0\bundle.jar
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
        at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
        at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258)
        at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
        ... 2 more
        Suppressed: java.nio.file.DirectoryNotEmptyException: C:\Users\Uzivatel\AppData\Local\Temp\junit-16411345319734003674
                at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:272)
                at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:105)
                at java.base/java.nio.file.Files.delete(Files.java:1152)
                at java.base/java.nio.file.Files.walkFileTree(Files.java:2828)
                at java.base/java.nio.file.Files.walkFileTree(Files.java:2882)
                ... 13 more
        Suppressed: java.nio.file.DirectoryNotEmptyException: C:\Users\Uzivatel\AppData\Local\Temp\junit-16411345319734003674\bundle7
                at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:272)
                at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:105)
                at java.base/java.nio.file.Files.delete(Files.java:1152)
                at java.base/java.nio.file.Files.walkFileTree(Files.java:2828)
                at java.base/java.nio.file.Files.walkFileTree(Files.java:2882)
                ... 13 more
        Suppressed: java.nio.file.DirectoryNotEmptyException: C:\Users\Uzivatel\AppData\Local\Temp\junit-16411345319734003674\bundle7\version0.0
                at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:272)
                at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:105)
                at java.base/java.nio.file.Files.delete(Files.java:1152)
                at java.base/java.nio.file.Files.walkFileTree(Files.java:2828)
                at java.base/java.nio.file.Files.walkFileTree(Files.java:2882)
                ... 13 more
        Suppressed: java.nio.file.FileSystemException: C:\Users\Uzivatel\AppData\Local\Temp\junit-16411345319734003674\bundle7\version0.0\bundle.jar: The process cannot access the file because it is being used by another process
                at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
                at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
                at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
                at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:275)
                at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:105)
                at java.base/java.nio.file.Files.delete(Files.java:1152)
                at java.base/java.nio.file.Files.walkFileTree(Files.java:2811)
                at java.base/java.nio.file.Files.walkFileTree(Files.java:2882)
                ... 13 more
                Suppressed: java.nio.file.FileSystemException: C:\Users\Uzivatel\AppData\Local\Temp\junit-16411345319734003674\bundle7\version0.0\bundle.jar: The process cannot access the file because it is being used by another process
                        ... 21 more

[INFO] Running com.kentyou.featurelauncher.impl.repository.LocalArtifactRepositoryImplTest
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.324 s -- in com.kentyou.featurelauncher.impl.repository.LocalArtifactRepositoryImplTest
[INFO] Running com.kentyou.featurelauncher.impl.repository.RemoteArtifactRepositoryImplTest
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.528 s -- in com.kentyou.featurelauncher.impl.repository.RemoteArtifactRepositoryImplTest
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]   FeatureLauncherImplTest.testLaunchFeatureWithConfigWithDefaultFramework » JUnit Failed to close extension context
[INFO]
[ERROR] Tests run: 39, Failures: 0, Errors: 1, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  25.403 s
[INFO] Finished at: 2024-10-27T19:43:46+01:00
[INFO] ------------------------------------------------------------------------

(...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions