tillrohrmann commented on a change in pull request #8242: [FLINK-6227][network] 
Introduce the DataConsumptionException for downstream task failure
URL: https://github.com/apache/flink/pull/8242#discussion_r280481073
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/LocalInputChannelTest.java
 ##########
 @@ -389,25 +401,80 @@ public void testGetNextAfterPartitionReleased() throws 
Exception {
                try {
                        channel.getNextBuffer();
                        fail("Did not throw expected CancelTaskException");
-               } catch (CancelTaskException ignored) {
+               } catch (DataConsumptionException ignored) {
                }
 
                channel.releaseAllResources();
                assertFalse(channel.getNextBuffer().isPresent());
        }
 
+       /**
+        * Tests the {@link PartitionNotFoundException} is thrown during 
requesting partition and
+        * wrapped into {@link DataConsumptionException}.
+        */
+       @Test
+       public void testDataConsumptionExceptionDuringPartitionRequest() throws 
Exception {
+               Tuple2<Integer, Integer> backoff = new Tuple2<>(0, 0);
+
+               ResultPartitionManager partitionManager = new 
ResultPartitionManager();
+
+               ResultPartitionID partitionId = new ResultPartitionID();
+
+               LocalInputChannel ch = createLocalInputChannel(
+                       InputChannelTestUtils.createSingleInputGate(1), 
partitionId, partitionManager, backoff);
+
+               try {
+                       ch.requestSubpartition(0);
+                       fail("Did not throw expected DataConsumptionException");
+               } catch (IOException ex) {
 
 Review comment:
   Same here, why not simply catching a `DataConsumptionException`?

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


With regards,
Apache Git Services

Reply via email to