pratyakshsharma commented on code in PR #6926:
URL: https://github.com/apache/hudi/pull/6926#discussion_r1007200255


##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/table/functional/TestCleanPlanExecutor.java:
##########
@@ -99,6 +99,206 @@ private static Stream<Arguments> 
argumentsForTestKeepLatestCommits() {
     );
   }
 
+  private static Stream<Arguments> argumentsForTestTriggerCleanEveryNCommits() 
{
+    return Stream.of(
+            Arguments.of(1),
+                Arguments.of(2),
+                Arguments.of(3),
+                Arguments.of(4)
+    );
+  }
+
+  @ParameterizedTest
+  @MethodSource("argumentsForTestTriggerCleanEveryNCommits")
+  public void testTriggerCleanEveryNthCommit(int minCommitsToTriggerClean) 
throws Exception {
+    HoodieWriteConfig config = 
HoodieWriteConfig.newBuilder().withPath(basePath)
+            
.withMetadataConfig(HoodieMetadataConfig.newBuilder().withAssumeDatePartitioning(true).enable(false).build())
+            .withEmbeddedTimelineServerEnabled(false)
+            .withCleanConfig(HoodieCleanConfig.newBuilder()
+                    
.withFailedWritesCleaningPolicy(HoodieFailedWritesCleaningPolicy.EAGER)
+                    
.withCleanerPolicy(HoodieCleaningPolicy.KEEP_LATEST_COMMITS)
+                    .retainCommits(1)
+                    .withMaxCommitsBeforeCleaning(minCommitsToTriggerClean)
+                    .build()).build();
+
+    HoodieTestTable testTable = HoodieTestTable.of(metaClient);

Review Comment:
   I see. I believe this is the missing piece I was looking for because the 
test case was failing in its current form with metadata table enabled. I am 
thinking of adding the other test case in this PR itself, so that we have a 
single PR for enhancing cleaner test cases. Open to hearing your thoughts 
though. 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to