From 25b10264b9f62a2c6db8da325465a0aa07c18373 Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Sat, 10 Aug 2024 10:08:49 +0200 Subject: [PATCH] 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 --- .../lambda/LogGeneratedClassesTest.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/test/jdk/java/lang/invoke/lambda/LogGeneratedClassesTest.java b/test/jdk/java/lang/invoke/lambda/LogGeneratedClassesTest.java index 91ea4b932..2c0d01692 100644 --- a/test/jdk/java/lang/invoke/lambda/LogGeneratedClassesTest.java +++ b/test/jdk/java/lang/invoke/lambda/LogGeneratedClassesTest.java @@ -207,14 +207,21 @@ public class LogGeneratedClassesTest { @Test public void testDumpDirNotWritable() throws Exception { - 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; } -- 2.30.2