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

gaurava pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new db81ea603cf HADOOP-19555. Fix testRenameFileWithFullQualifiedPath on 
Windows (#7654)
db81ea603cf is described below

commit db81ea603cf7e6a36099b4f0ee65fc9a719f6543
Author: Gautham B A <gautham.bangal...@gmail.com>
AuthorDate: Wed Apr 30 09:35:47 2025 +0530

    HADOOP-19555. Fix testRenameFileWithFullQualifiedPath on Windows (#7654)
    
    * This PR fixes the unit test failure caused by
      incorrectly using the absolute path for FS
      operations on the `FTPFileSystem`.
---
 .../src/test/java/org/apache/hadoop/fs/ftp/TestFTPFileSystem.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/ftp/TestFTPFileSystem.java
 
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/ftp/TestFTPFileSystem.java
index 1760af68396..1cfca58ad17 100644
--- 
a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/ftp/TestFTPFileSystem.java
+++ 
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/ftp/TestFTPFileSystem.java
@@ -236,7 +236,8 @@ public void testFTPSetTimeout() {
 
   private static void touch(FileSystem fs, Path filePath)
           throws IOException {
-    touch(fs, filePath, null);
+    // Create a file with a single byte of data.
+    touch(fs, filePath, new byte[] {1});
   }
 
   private static void touch(FileSystem fs, Path path, byte[] data)
@@ -266,8 +267,9 @@ public void testRenameFileWithFullQualifiedPath() throws 
Exception {
 
     FileSystem fs = FileSystem.get(configuration);
 
-
-    Path ftpDir = fs.makeQualified(new 
Path(testDir.toAbsolutePath().toString()));
+    // All the file operations will be relative to the root directory 
specified by the testDir
+    // member variable.
+    Path ftpDir = fs.makeQualified(new Path("/"));
     Path file1 = fs.makeQualified(new Path(ftpDir, "renamefile" + "1"));
     Path file2 = fs.makeQualified(new Path(ftpDir, "renamefile" + "2"));
     touch(fs, file1);


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to