tillrohrmann commented on a change in pull request #8242: [FLINK-6227][network]
Introduce the PartitionException for downstream task failure
URL: https://github.com/apache/flink/pull/8242#discussion_r285953276
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/LocalInputChannelTest.java
##########
@@ -269,6 +272,73 @@ public void testProducerFailedException() throws
Exception {
ch.getNextBuffer();
}
+ /**
+ * Tests that {@link LocalInputChannel#requestSubpartition(int)} throws
{@link PartitionNotFoundException}
+ * if the result partition was not registered in {@link
ResultPartitionManager} and no backoff.
+ */
+ @Test
+ public void testPartitionNotFoundExceptionWhileRequestingPartition()
throws Exception {
+ final SingleInputGate inputGate = createSingleInputGate(1);
+ final LocalInputChannel localChannel =
createLocalInputChannel(inputGate, new ResultPartitionManager());
+
+ try {
+ localChannel.requestSubpartition(0);
+
+ fail("Should throw PartitionNotFoundException while
requesting unregistered partition.");
+ } catch (PartitionNotFoundException notFound) {
+ assertThat(localChannel.getPartitionId(),
Matchers.is(notFound.getPartitionId()));
+ }
+ }
+
+ /**
+ * Tests that {@link
SingleInputGate#retriggerPartitionRequest(IntermediateResultPartitionID)} is
triggered
+ * after {@link LocalInputChannel#requestSubpartition(int)} throws
{@link PartitionNotFoundException}
+ * within backoff.
+ */
+ @Test
+ public void testRetriggerPartitionRequestWhilePartitionNotFound()
throws Exception {
+ final SingleInputGate inputGate = createSingleInputGate(1);
+ final LocalInputChannel localChannel = createLocalInputChannel(
+ inputGate, new ResultPartitionManager(), 1, 1);
+
+
inputGate.setInputChannel(localChannel.getPartitionId().getPartitionId(),
localChannel);
+ localChannel.requestSubpartition(0);
+
+ // The timer should be initialized at the first time of
retriggering partition request.
+ assertNotNull(inputGate.getRetriggerLocalRequestTimer());
Review comment:
I don't see where the `PartitionNotFoundException` is being asserted as
described in the JavaDocs.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services