mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-09 21:19:38 +00:00
8381984: Test jdk/nio/zipfs/ZipFSTester.java fails with mismatched timestamp
Reviewed-by: jpai, lancea
This commit is contained in:
parent
601c1fec8b
commit
b8189ae809
@ -646,6 +646,11 @@ public class ZipFSTester {
|
||||
@Test
|
||||
void testTime() throws Exception {
|
||||
var jar = Utils.createJarFile(System.currentTimeMillis() + ".jar", jarContents);
|
||||
// Read JAR source once before capturing file attributes.
|
||||
// This stabilizes access time before the copy operation.
|
||||
try (InputStream in = Files.newInputStream(jar)) {
|
||||
in.transferTo(OutputStream.nullOutputStream()); // output is irrelevant
|
||||
}
|
||||
BasicFileAttributes attrs = Files
|
||||
.getFileAttributeView(jar, BasicFileAttributeView.class)
|
||||
.readAttributes();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user