HADOOP-14486 TestSFTPFileSystem#testGetAccessTime test failure using openJDK 1.8.0.

Contributed by Hongyuan Li.
This commit is contained in:
Steve Loughran 2017-06-16 09:45:22 +01:00
parent e855cc4ed4
commit 942ecbbc98
No known key found for this signature in database
GPG Key ID: 950CC3E032B79CA2

View File

@ -315,6 +315,7 @@ public void testGetAccessTime() throws IOException {
java.nio.file.Path path = (local).pathToFile(file).toPath(); java.nio.file.Path path = (local).pathToFile(file).toPath();
long accessTime1 = Files.readAttributes(path, BasicFileAttributes.class) long accessTime1 = Files.readAttributes(path, BasicFileAttributes.class)
.lastAccessTime().toMillis(); .lastAccessTime().toMillis();
accessTime1 = (accessTime1 / 1000) * 1000;
long accessTime2 = sftpFs.getFileStatus(file).getAccessTime(); long accessTime2 = sftpFs.getFileStatus(file).getAccessTime();
assertEquals(accessTime1, accessTime2); assertEquals(accessTime1, accessTime2);
} }