23 |
23 |
24 /** |
24 /** |
25 * @test |
25 * @test |
26 * @bug 8137121 8137230 |
26 * @bug 8137121 8137230 |
27 * @summary (fc) Infinite loop FileChannel.truncate |
27 * @summary (fc) Infinite loop FileChannel.truncate |
28 * @library /lib/testlibrary |
28 * @library /test/lib |
29 * @build jdk.testlibrary.Utils |
29 * @build jdk.test.lib.Utils |
30 * @run main/othervm/timeout=300 LoopingTruncate |
30 * @run main/othervm/timeout=300 LoopingTruncate |
31 */ |
31 */ |
32 |
32 |
33 import java.nio.ByteBuffer; |
33 import java.nio.ByteBuffer; |
34 import java.nio.channels.FileChannel; |
34 import java.nio.channels.FileChannel; |
35 import java.nio.channels.ClosedByInterruptException; |
35 import java.nio.channels.ClosedByInterruptException; |
36 import java.nio.file.Files; |
36 import java.nio.file.Files; |
37 import java.nio.file.Path; |
37 import java.nio.file.Path; |
38 import static java.nio.file.StandardOpenOption.*; |
38 import static java.nio.file.StandardOpenOption.*; |
39 import java.util.concurrent.TimeUnit; |
39 import java.util.concurrent.TimeUnit; |
40 import static jdk.testlibrary.Utils.adjustTimeout; |
40 import static jdk.test.lib.Utils.adjustTimeout; |
41 |
41 |
42 public class LoopingTruncate { |
42 public class LoopingTruncate { |
43 |
43 |
44 // (int)FATEFUL_SIZE == -3 == IOStatus.INTERRUPTED |
44 // (int)FATEFUL_SIZE == -3 == IOStatus.INTERRUPTED |
45 static long FATEFUL_SIZE = 0x1FFFFFFFDL; |
45 static long FATEFUL_SIZE = 0x1FFFFFFFDL; |