Skip to content

Commit

Permalink
[HUDI-4053] Flaky ITTestHoodieDataSource.testStreamWriteBatchReadOpti… (
Browse files Browse the repository at this point in the history
apache#5526)

* [HUDI-4053] Flaky ITTestHoodieDataSource.testStreamWriteBatchReadOptimized

Co-authored-by: xicm <xicm@asiainfo.com>
  • Loading branch information
2 people authored and yihua committed Jun 3, 2022
1 parent 2f0f3b5 commit 38c1390
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,15 @@ void testStreamWriteBatchReadOptimized() {

List<Row> rows = CollectionUtil.iterableToList(
() -> streamTableEnv.sqlQuery("select * from t1").execute().collect());
assertRowsEquals(rows, TestData.DATA_SET_SOURCE_INSERT);

// the test is flaky based on whether the first compaction is pending when
// scheduling the 2nd compaction.
// see details in CompactionPlanOperator#scheduleCompaction.
if (rows.size() < TestData.DATA_SET_SOURCE_INSERT.size()) {
assertRowsEquals(rows, TestData.DATA_SET_SOURCE_INSERT_FIRST_COMMIT);
} else {
assertRowsEquals(rows, TestData.DATA_SET_SOURCE_INSERT);
}
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,18 @@ public class TestData {
TimestampData.fromEpochMillis(8000), StringData.fromString("par4"))
);

// data set of test_source.data first commit.
public static List<RowData> DATA_SET_SOURCE_INSERT_FIRST_COMMIT = Arrays.asList(
insertRow(StringData.fromString("id1"), StringData.fromString("Danny"), 23,
TimestampData.fromEpochMillis(1000), StringData.fromString("par1")),
insertRow(StringData.fromString("id2"), StringData.fromString("Stephen"), 33,
TimestampData.fromEpochMillis(2000), StringData.fromString("par1")),
insertRow(StringData.fromString("id3"), StringData.fromString("Julian"), 53,
TimestampData.fromEpochMillis(3000), StringData.fromString("par2")),
insertRow(StringData.fromString("id4"), StringData.fromString("Fabian"), 31,
TimestampData.fromEpochMillis(4000), StringData.fromString("par2"))
);

// data set of test_source.data latest commit.
public static List<RowData> DATA_SET_SOURCE_INSERT_LATEST_COMMIT = Arrays.asList(
insertRow(StringData.fromString("id5"), StringData.fromString("Sophia"), 18,
Expand Down

0 comments on commit 38c1390

Please sign in to comment.