flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] zhijiangW commented on a change in pull request #8242: [FLINK-6227][network] Introduce the PartitionException for downstream task failure
Date Fri, 17 May 2019 15:20:45 GMT
zhijiangW 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_r285172794
 
 

 ##########
 File path: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/LocalInputChannelTest.java
 ##########
 @@ -269,6 +270,24 @@ 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} before.
+	 */
+	@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) {
+			assertEquals(localChannel.getPartitionId(), notFound.getPartitionId());
+		}
+	}
 
 Review comment:
   Yes, you are right, we should add this path.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message