1
0

[HUDI-2696] Remove the aborted checkpoint notification from coordinator (#3926)

This commit is contained in:
Danny Chan
2021-11-05 16:37:23 +08:00
committed by GitHub
parent f67da0c7d0
commit 3af6568d31
7 changed files with 32 additions and 66 deletions

View File

@@ -95,8 +95,8 @@ public class TestWriteCopyOnWrite extends TestWriteBase {
.assertEmptyEvent()
.checkpointFails(1)
.consume(TestData.DATA_SET_INSERT)
.checkpointNotThrow(2,
"The stream writer reuse the last instant time when waiting for the last instant commit timeout")
.checkpointThrows(2,
"Timeout(1000ms) while waiting for instant initialize")
// do not send the write event and fails the checkpoint,
// behaves like the last checkpoint is successful.
.checkpointFails(2)
@@ -390,7 +390,8 @@ public class TestWriteCopyOnWrite extends TestWriteBase {
.consume(TestData.DATA_SET_INSERT)
.assertNotConfirming()
.checkpoint(2)
.assertConsumeDoesNotThrow(TestData.DATA_SET_INSERT)
.assertConsumeThrows(TestData.DATA_SET_INSERT,
"Timeout(1000ms) while waiting for instant initialize")
.end();
}

View File

@@ -27,6 +27,7 @@ import org.apache.hudi.common.table.TableSchemaResolver;
import org.apache.hudi.common.table.timeline.HoodieInstant;
import org.apache.hudi.configuration.FlinkOptions;
import org.apache.hudi.configuration.OptionsResolver;
import org.apache.hudi.exception.HoodieException;
import org.apache.hudi.sink.event.WriteMetadataEvent;
import org.apache.hudi.util.StreamerUtil;
import org.apache.hudi.utils.TestData;
@@ -51,11 +52,11 @@ import java.util.stream.Collectors;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
@@ -151,10 +152,8 @@ public class TestWriteBase {
return this;
}
public TestHarness assertConsumeDoesNotThrow(List<RowData> inputs) {
assertDoesNotThrow(() -> {
consume(inputs);
}, "The stream writer reuse the last instant time when waiting for the last instant commit timeout");
public TestHarness assertConsumeThrows(List<RowData> inputs, String message) {
assertThrows(HoodieException.class, () -> consume(inputs), message);
return this;
}
@@ -294,9 +293,9 @@ public class TestWriteBase {
return this;
}
public TestHarness checkpointNotThrow(long checkpointId, String message) {
public TestHarness checkpointThrows(long checkpointId, String message) {
// this returns early because there is no inflight instant
assertDoesNotThrow(() -> checkpoint(checkpointId), message);
assertThrows(HoodieException.class, () -> checkpoint(checkpointId), message);
return this;
}