You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/10/25 07:56:44 UTC

[GitHub] [hudi] xicm commented on a diff in pull request #7020: [HUDI-5069] TestInlineCompaction.testSuccessfulCompactionBasedOnNumAndTime is flaky

xicm commented on code in PR #7020:
URL: https://github.com/apache/hudi/pull/7020#discussion_r1004130734


##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/table/action/compact/TestInlineCompaction.java:
##########
@@ -229,6 +229,9 @@ public void testSuccessfulCompactionBasedOnNumAndTime() throws Exception {
 
       // Then: ensure no compaction is executed since there are only 3 delta commits
       assertEquals(3, metaClient.getActiveTimeline().getWriteTimeline().countInstants());
+
+      // Ensure the elapsed time > INLINE_COMPACT_TIME_DELTA_SECONDS
+      Thread.sleep(60 * 1000);

Review Comment:
   I run this test on my laptop and get an assert exception
   ```
   org.opentest4j.AssertionFailedError: Expect baseInstant to be less than or equal to latestDeltaCommit ==> 
   Expected :true
   Actual   :false
   <Click to see difference>
   
   
   	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
   	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:40)
   	at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:193)
   	at org.apache.hudi.table.action.compact.CompactionTestBase.lambda$validateDeltaCommit$0(CompactionTestBase.java:103)
   	at java.util.ArrayList.forEach(ArrayList.java:1257)
   	at org.apache.hudi.table.action.compact.CompactionTestBase.validateDeltaCommit(CompactionTestBase.java:95)
   	at org.apache.hudi.table.action.compact.CompactionTestBase.runNextDeltaCommits(CompactionTestBase.java:148)
   	at org.apache.hudi.table.action.compact.TestInlineCompaction.testSuccessfulCompactionBasedOnNumAndTime(TestInlineCompaction.java:227)
   ```
   
   The original ut has two conditions: 
   1. the elapsed time should less than 20s when the 3rd delta commits finishes. 
   2. the elapsed time should greater than 20s when the 4th delta commits finishes. 
   
   Actually, the elapsed time reaches 20s  when the 3rd delta commits finishes on my laptop, the compaction is executed earlier than expected.
   
   So I increase the INLINE_COMPACT_TIME_DELTA_SECONDS  to ensure 3 delta commits can be finished in 60s. The sleep is to ensure compaction can be executed after the 4th commits.
   
   



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org