Skip to content

Commit 93b0f54

Browse files
committed
HADOOP-15783. [JDK10] TestSFTPFileSystem.testGetModifyTime fails.
1 parent 50bc774 commit 93b0f54

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ public void testGetAccessTime() throws IOException {
315315
java.nio.file.Path path = (local).pathToFile(file).toPath();
316316
long accessTime1 = Files.readAttributes(path, BasicFileAttributes.class)
317317
.lastAccessTime().toMillis();
318+
// SFTPFileSystem doesn't have milliseconds. Excluding it.
318319
accessTime1 = (accessTime1 / 1000) * 1000;
319320
long accessTime2 = sftpFs.getFileStatus(file).getAccessTime();
320321
assertEquals(accessTime1, accessTime2);
@@ -325,6 +326,8 @@ public void testGetModifyTime() throws IOException {
325326
Path file = touch(localFs, name.getMethodName().toLowerCase() + "1");
326327
java.io.File localFile = ((LocalFileSystem) localFs).pathToFile(file);
327328
long modifyTime1 = localFile.lastModified();
329+
// SFTPFileSystem doesn't have milliseconds. Excluding it.
330+
modifyTime1 = (modifyTime1 / 1000) * 1000;
328331
long modifyTime2 = sftpFs.getFileStatus(file).getModificationTime();
329332
assertEquals(modifyTime1, modifyTime2);
330333
}

0 commit comments

Comments
 (0)