This is an automated email from the ASF dual-hosted git repository.

aajisaka pushed a commit to branch branch-2.10
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-2.10 by this push:
     new e71d57edc7a HADOOP-15783. [JDK10] TestSFTPFileSystem.testGetModifyTime 
fails. (#4218)
e71d57edc7a is described below

commit e71d57edc7ad990cfd788d06f9b192bed4d83f2f
Author: Xing Lin <[email protected]>
AuthorDate: Thu Apr 21 23:42:36 2022 -0700

    HADOOP-15783. [JDK10] TestSFTPFileSystem.testGetModifyTime fails. (#4218)
    
    (cherry picked from commit 93b0f540ed52f31c53fe4afc6d423e64c57c0af2)
    
    Co-authored-by: Akira Ajisaka <[email protected]>
---
 .../src/test/java/org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java    | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java
 
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java
index 4be73e78619..8a65dba7959 100644
--- 
a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java
+++ 
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java
@@ -316,6 +316,7 @@ public class TestSFTPFileSystem {
     java.nio.file.Path path = (local).pathToFile(file).toPath();
     long accessTime1 = Files.readAttributes(path, BasicFileAttributes.class)
         .lastAccessTime().toMillis();
+    // SFTPFileSystem doesn't have milliseconds. Excluding it.
     accessTime1 = (accessTime1 / 1000) * 1000;
     long accessTime2 = sftpFs.getFileStatus(file).getAccessTime();
     assertEquals(accessTime1, accessTime2);
@@ -326,6 +327,8 @@ public class TestSFTPFileSystem {
     Path file = touch(localFs, name.getMethodName().toLowerCase() + "1");
     java.io.File localFile = ((LocalFileSystem) localFs).pathToFile(file);
     long modifyTime1 = localFile.lastModified();
+    // SFTPFileSystem doesn't have milliseconds. Excluding it.
+    modifyTime1 = (modifyTime1 / 1000) * 1000;
     long modifyTime2 = sftpFs.getFileStatus(file).getModificationTime();
     assertEquals(modifyTime1, modifyTime2);
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to