Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KarafTestContainer.stop to also handle UncheckedIOException #1110

Open
lichtin opened this issue Dec 20, 2023 · 0 comments
Open

KarafTestContainer.stop to also handle UncheckedIOException #1110

lichtin opened this issue Dec 20, 2023 · 0 comments

Comments

@lichtin
Copy link

lichtin commented Dec 20, 2023

This section here should also catch UncheckedIOException

            if (shouldDeleteRuntime()) {
                system.clear();
                try {
                    FileUtils.forceDelete(targetFolder);
                }
                catch (IOException e) {
                    forceCleanup();
                }
            }

as can be seen by this stacktrace

java.io.UncheckedIOException: java.nio.file.NoSuchFileException: /jenkins/.../target/paxexam
	at org.apache.commons.io.function.Uncheck.wrap(Uncheck.java:242)
	at org.apache.commons.io.function.Uncheck.apply(Uncheck.java:164)
	at org.apache.commons.io.file.PathUtils.readAttributes(PathUtils.java:1259)
	at org.apache.commons.io.file.PathUtils.readPosixFileAttributes(PathUtils.java:1349)
	at org.apache.commons.io.file.PathUtils.deleteFile(PathUtils.java:582)
	at org.apache.commons.io.file.PathUtils.delete(PathUtils.java:476)
	at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1337)
	at org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.stop(KarafTestContainer.java:707)
	at org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.tearDown(EagerSingleStagedReactor.java:118)
	at org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.afterClass(EagerSingleStagedReactor.java:132)
	at org.ops4j.pax.exam.spi.reactors.ReactorManager.afterClass(ReactorManager.java:441)
	at org.ops4j.pax.exam.junit.impl.ProbeRunner.run(ProbeRunner.java:107)
	at org.ops4j.pax.exam.junit.PaxExam.run(PaxExam.java:93)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant