bgaborg commented on a change in pull request #1851: HADOOP-16858. S3Guard
fsck: Add option to remove orphaned entries
URL: https://github.com/apache/hadoop/pull/1851#discussion_r384494819
##########
File path:
hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/s3guard/ITestS3GuardToolDynamoDB.java
##########
@@ -353,6 +353,28 @@ public void testCLIFsckCheckExclusive() throws Exception {
"s3a://" + getFileSystem().getBucket()));
}
+ @Test
+ public void testCLIFsckDDbFixOnlyFails() throws Exception {
+ describe("This test serves the purpose to run fsck with the correct " +
+ "parameters, so there will be no exception thrown.");
+ final int result = run(S3GuardTool.Fsck.NAME,
+ "-" + Fsck.FIX_FLAG,
+ "s3a://" + getFileSystem().getBucket());
+ LOG.info("The return value of the run: {}", result);
+ assertEquals(ERROR, result);
+ }
+
+ @Test
+ public void testCLIFsckDDbFixAndInternalSucceed() throws Exception {
+ describe("This test serves the purpose to run fsck with the correct " +
+ "parameters, so there will be no exception thrown.");
+ final int result = run(S3GuardTool.Fsck.NAME,
+ "-" + Fsck.FIX_FLAG,
+ "-" + Fsck.DDB_MS_CONSISTENCY_FLAG,
+ "s3a://" + getFileSystem().getBucket());
+ LOG.info("The return value of the run: {}", result);
Review comment:
There is no assert here because we can not assert on the result - there
maybe some errors found during the check and the returned value will be ERROR
and not SUCCESS. So if we assert on SUCCESS, then the test could (likely) to be
flaky.
We want the test to fail or pass - and we don't expect any exceptions here
so if the parameters are not accepted the test will fail, and this is enough
check here.
I'll add a javadoc on the top of the method about 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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]