steveloughran commented on a change in pull request #1404: HDFS-13660 Copy file 
till the source file length during distcp
URL: https://github.com/apache/hadoop/pull/1404#discussion_r324232111
 
 

 ##########
 File path: 
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/util/TestDistCpUtils.java
 ##########
 @@ -1224,22 +1225,18 @@ public void testCompareFileLengthsAndChecksums() 
throws IOException {
     Path dstWithLen0 = new Path(base + "dstLen0");
     fs.create(srcWithLen0).close();
     fs.create(dstWithLen0).close();
-    DistCpUtils.compareFileLengthsAndChecksums(fs, srcWithLen0,
-        null, fs, dstWithLen0, false);
+    DistCpUtils.compareFileLengthsAndChecksums(0, fs, srcWithLen0,
+        null, fs, dstWithLen0, false, 0);
 
     // different lengths comparison
     Path srcWithLen1 = new Path(base + "srcLen1");
     Path dstWithLen2 = new Path(base + "dstLen2");
     DFSTestUtil.createFile(fs, srcWithLen1, 1, replFactor, srcSeed);
     DFSTestUtil.createFile(fs, dstWithLen2, 2, replFactor, srcSeed);
-    try {
-      DistCpUtils.compareFileLengthsAndChecksums(fs, srcWithLen1,
-          null, fs, dstWithLen2, false);
-      Assert.fail("Expected different lengths comparison to fail!");
-    } catch (IOException e) {
-      GenericTestUtils.assertExceptionContains(
-          "Mismatch in length", e);
-    }
+
+    intercept(IOException.class, DistCpConstants.LENGTH_MISMATCH_ERROR_MSG,
 
 Review comment:
   this is good, thanks for doing this

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to