Skip to content

Commit

Permalink
[HUDI-4695] Fixing flaky TestInlineCompaction#testCompactionRetryOnFa…
Browse files Browse the repository at this point in the history
…ilureBasedOnTime (#6534)
  • Loading branch information
nsivabalan authored Aug 30, 2022
1 parent 30e36f3 commit d7a5240
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,9 @@ public void testCompactionRetryOnFailureBasedOnTime() throws Exception {
moveCompactionFromRequestedToInflight(instantTime, cfg);
}

// When: commit happens after 10s
HoodieWriteConfig inlineCfg = getConfigForInlineCompaction(5, 10, CompactionTriggerStrategy.TIME_ELAPSED);
// 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
// rolledback and retried to move it to completion.
HoodieWriteConfig inlineCfg = getConfigForInlineCompaction(5, 1000, CompactionTriggerStrategy.TIME_ELAPSED);
String instantTime2;
try (SparkRDDWriteClient<?> writeClient = getHoodieWriteClient(inlineCfg)) {
HoodieTableMetaClient metaClient = HoodieTableMetaClient.builder().setConf(hadoopConf).setBasePath(cfg.getBasePath()).build();
Expand All @@ -305,6 +306,7 @@ public void testCompactionRetryOnFailureBasedOnTime() throws Exception {

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

0 comments on commit d7a5240

Please sign in to comment.