This is an automated email from the ASF dual-hosted git repository. yihua pushed a commit to branch release-1.1.0 in repository https://gitbox.apache.org/repos/asf/hudi.git
commit f351b0033a6d3c14c8b8c6ba60c00083f401eb0e Author: TheR1sing3un <[email protected]> AuthorDate: Thu Nov 6 10:18:25 2025 +0800 test: fix flaky test case in TestBootstrapReadBase (#14210) Signed-off-by: TheR1sing3un <[email protected]> Co-authored-by: Y Ethan Guo <[email protected]> --- .../hudi/functional/TestBootstrapReadBase.java | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/functional/TestBootstrapReadBase.java b/hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/functional/TestBootstrapReadBase.java index f48636eec9f6..a29ee0696b6d 100644 --- a/hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/functional/TestBootstrapReadBase.java +++ b/hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/functional/TestBootstrapReadBase.java @@ -48,6 +48,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import java.util.stream.Collectors; import static org.apache.hudi.common.model.HoodieTableType.MERGE_ON_READ; @@ -76,10 +77,11 @@ public abstract class TestBootstrapReadBase extends HoodieSparkClientTestBase { @BeforeEach public void setUp() throws Exception { - bootstrapBasePath = tmpFolder.toAbsolutePath() + "/bootstrapBasePath"; - hudiBasePath = tmpFolder.toAbsolutePath() + "/hudiBasePath"; - bootstrapTargetPath = tmpFolder.toAbsolutePath() + "/bootstrapTargetPath"; - initSparkContexts(); + String randomUuid = UUID.randomUUID().toString(); + bootstrapBasePath = tmpFolder.toAbsolutePath() + "/" + randomUuid + "/bootstrapBasePath"; + hudiBasePath = tmpFolder.toAbsolutePath() + "/" + randomUuid + "/hudiBasePath"; + bootstrapTargetPath = tmpFolder.toAbsolutePath() + "/" + randomUuid + "/bootstrapTargetPath"; + initSparkContexts(this.getClass().getSimpleName() + randomUuid); } @AfterEach @@ -207,8 +209,18 @@ public abstract class TestBootstrapReadBase extends HoodieSparkClientTestBase { } protected void compareDf(Dataset<Row> df1, Dataset<Row> df2) { - assertEquals(0, df1.except(df2).count()); - assertEquals(0, df2.except(df1).count()); + Dataset<Row> difference1 = df1.except(df2); + long diff1Count = difference1.count(); + if (diff1Count > 0) { + difference1.show(100, false); + } + Dataset<Row> difference2 = df2.except(df1); + long diff2Count = difference2.count(); + if (diff2Count > 0) { + difference2.show(100, false); + } + assertEquals(0, diff1Count); + assertEquals(0, diff2Count); } protected void setupDirs() {
