Skip to content

Commit d7a5240

Browse files
authored
[HUDI-4695] Fixing flaky TestInlineCompaction#testCompactionRetryOnFailureBasedOnTime (#6534)
1 parent 30e36f3 commit d7a5240

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/table/action/compact/TestInlineCompaction.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,9 @@ public void testCompactionRetryOnFailureBasedOnTime() throws Exception {
294294
moveCompactionFromRequestedToInflight(instantTime, cfg);
295295
}
296296

297-
// When: commit happens after 10s
298-
HoodieWriteConfig inlineCfg = getConfigForInlineCompaction(5, 10, CompactionTriggerStrategy.TIME_ELAPSED);
297+
// When: commit happens after 1000s. assumption is that, there won't be any new compaction getting scheduled within 100s, but the previous failed one will be
298+
// rolledback and retried to move it to completion.
299+
HoodieWriteConfig inlineCfg = getConfigForInlineCompaction(5, 1000, CompactionTriggerStrategy.TIME_ELAPSED);
299300
String instantTime2;
300301
try (SparkRDDWriteClient<?> writeClient = getHoodieWriteClient(inlineCfg)) {
301302
HoodieTableMetaClient metaClient = HoodieTableMetaClient.builder().setConf(hadoopConf).setBasePath(cfg.getBasePath()).build();
@@ -305,6 +306,7 @@ public void testCompactionRetryOnFailureBasedOnTime() throws Exception {
305306

306307
// Then: 1 delta commit is done, the failed compaction is retried
307308
metaClient = HoodieTableMetaClient.builder().setConf(hadoopConf).setBasePath(cfg.getBasePath()).build();
309+
// 2 delta commits at the beginning. 1 compaction, 1 delta commit following it.
308310
assertEquals(4, metaClient.getActiveTimeline().getWriteTimeline().countInstants());
309311
assertEquals(instantTime, metaClient.getActiveTimeline().getCommitTimeline().filterCompletedInstants().firstInstant().get().getTimestamp());
310312
}

0 commit comments

Comments
 (0)