From 1887a80260abc7d5ef4fb70a7a7a740751fdb398 Mon Sep 17 00:00:00 2001 From: Amos Shi <ashi@openjdk.org> Date: Mon, 26 Aug 2024 17:28:40 +0000 Subject: [PATCH] 8332248: (fc) java/nio/channels/FileChannel/BlockDeviceSize.java failed with RuntimeException Backport-of: 0bb5ae645165b97527ecccf02308df6072c363d8 --- test/jdk/java/nio/channels/FileChannel/BlockDeviceSize.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/jdk/java/nio/channels/FileChannel/BlockDeviceSize.java b/test/jdk/java/nio/channels/FileChannel/BlockDeviceSize.java index 7d430693b2f..84e0bf0dd39 100644 --- a/test/jdk/java/nio/channels/FileChannel/BlockDeviceSize.java +++ b/test/jdk/java/nio/channels/FileChannel/BlockDeviceSize.java @@ -25,6 +25,7 @@ * @bug 8054029 * @requires (os.family == "linux") * @summary FileChannel.size() should be equal to RandomAccessFile.size() and > 0 for block devs on Linux + * @library /test/lib */ import java.io.RandomAccessFile; @@ -36,6 +37,7 @@ import java.util.List; import static java.nio.file.StandardOpenOption.*; +import jtreg.SkippedException; public class BlockDeviceSize { private static final List<String> BLK_FNAMES = List.of("/dev/sda1", "/dev/nvme0n1", "/dev/xvda1") ; @@ -61,7 +63,7 @@ public class BlockDeviceSize { System.err.println("File " + blkFname + " not found." + " Skipping test"); } catch (AccessDeniedException ade) { - throw new RuntimeException("Access to " + blkFname + " is denied." + throw new SkippedException("Access to " + blkFname + " is denied." + " Run test as root.", ade); } -- GitLab