steveloughran commented on a change in pull request #2861:
URL: https://github.com/apache/hadoop/pull/2861#discussion_r611599905
##########
File path:
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/contract/AbstractContractDistCpTest.java
##########
@@ -628,8 +629,15 @@ public void testDistCpWithIterator() throws Exception {
GenericTestUtils
.createFiles(remoteFS, source, getDepth(), getWidth(), getWidth());
+ GenericTestUtils.LogCapturer log =
+ GenericTestUtils.LogCapturer.captureLogs(SimpleCopyListing.LOG);
+
DistCpTestUtils.assertRunDistCp(DistCpConstants.SUCCESS, source.toString(),
- dest.toString(), "-useiterator", conf);
+ dest.toString(), "-useiterator -update -delete", conf);
+
+ // Check the target listing was also done using iterator.
+ assertTrue(log.getOutput().contains(
Review comment:
I'd use assertThat(string).contains(...)
##########
File path:
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/contract/AbstractContractDistCpTest.java
##########
@@ -628,8 +629,15 @@ public void testDistCpWithIterator() throws Exception {
GenericTestUtils
.createFiles(remoteFS, source, getDepth(), getWidth(), getWidth());
+ GenericTestUtils.LogCapturer log =
Review comment:
Not over-enamoured of this test strategy. As well as being brittle,
every use of this is going to complicate our move to Log4J2.
Is there any other way we could do this?
If the distcp test collected the IOStatistics of iteration, then those
stores which returned it from iterators (s3a currently, abfs is still WiP)
could count it and actually assert on real invocations. HDFS Doesn't do 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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]