danny0405 commented on code in PR #10820:
URL: https://github.com/apache/hudi/pull/10820#discussion_r1524566544


##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/client/functional/TestHoodieBackedMetadata.java:
##########
@@ -2901,6 +2904,42 @@ public void testMetadataTableWithLongLog() throws 
Exception {
     assertTrue(t.getMessage().startsWith(String.format("Metadata table's 
deltacommits exceeded %d: ", maxNumDeltacommits)));
   }
 
+  @Test
+  public void testMORCheckNumDeltaCommits() throws Exception {
+    init(MERGE_ON_READ, true);
+    final int maxNumDeltaCommits = 3;
+    writeConfig = getWriteConfigBuilder(true, true, false)
+            .withMetadataConfig(HoodieMetadataConfig.newBuilder()
+                    .enable(true)
+                    .enableMetrics(false)
+                    .withMaxNumDeltaCommitsBeforeCompaction(maxNumDeltaCommits 
- 1)
+                    .withMaxNumDeltacommitsWhenPending(maxNumDeltaCommits)
+                    .build())
+            .build();
+    initWriteConfigAndMetatableWriter(writeConfig, true);
+    // write deltacommits to data-table and do compaction in metadata-table 
(with commit-instant)
+    doWriteOperation(testTable, HoodieInstantTimeGenerator.formatDate(new 
Date()));

Review Comment:
   Maybe you can use `InProcessTimeGenerator` which ensures the distinctness of 
each instant timestamp.



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