From: Vladimir Petko Date: Sat, 16 Sep 2023 11:35:34 +0000 (+0100) Subject: Skip test when getFileStore() fails X-Git-Tag: archive/raspbian/17.0.9+9-1+rpi1^2^2~7 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2319be30e2b1ead33232b9835e537ccc34f712cb;p=openjdk-17.git Skip test when getFileStore() fails Bug: https://bugs.openjdk.org/browse/JDK-8166162 Forwarded: not-needed Last-Update: 2023-03-27 Due to https://bugs.openjdk.org/browse/JDK-8166162 getFileStore() fails with exception failing the test suite. Skip test when getFileStore() throws. Gbp-Pq: Name log-generated-classes-test.patch --- diff --git a/test/jdk/java/lang/invoke/lambda/LogGeneratedClassesTest.java b/test/jdk/java/lang/invoke/lambda/LogGeneratedClassesTest.java index d75e9b4d2..5b4316b37 100644 --- a/test/jdk/java/lang/invoke/lambda/LogGeneratedClassesTest.java +++ b/test/jdk/java/lang/invoke/lambda/LogGeneratedClassesTest.java @@ -195,14 +195,21 @@ public class LogGeneratedClassesTest extends LUtils { @Test public void testDumpDirNotWritable() throws IOException { - if (!Files.getFileStore(Paths.get(".")) - .supportsFileAttributeView(PosixFileAttributeView.class)) { - // No easy way to setup readonly directory without POSIX - // We would like to skip the test with a cause with - // throw new SkipException("Posix not supported"); - // but jtreg will report failure so we just pass the test - // which we can look at if jtreg changed its behavior - System.out.println("WARNING: POSIX is not supported. Skipping testDumpDirNotWritable test."); + try + { + if (!Files.getFileStore(Paths.get(".")) + .supportsFileAttributeView(PosixFileAttributeView.class)) { + // No easy way to setup readonly directory without POSIX + // We would like to skip the test with a cause with + // throw new SkipException("Posix not supported"); + // but jtreg will report failure so we just pass the test + // which we can look at if jtreg changed its behavior + System.out.println("WARNING: POSIX is not supported. Skipping testDumpDirNotWritable test."); + return; + } + } + catch (Throwable t) { + System.out.println("WARNING: Mount point not found (JDK-8166162). Skipping testDumpDirNotWritable test."); return; }