use of org.apache.flink.runtime.io.network.partition.ProducerFailedException in project flink by apache.
the class RemoteInputChannelTest method testProducerFailedException.
@Test(expected = CancelTaskException.class)
public void testProducerFailedException() throws Exception {
ConnectionManager connManager = mock(ConnectionManager.class);
when(connManager.createPartitionRequestClient(any(ConnectionID.class))).thenReturn(mock(PartitionRequestClient.class));
final SingleInputGate gate = createSingleInputGate(1);
final RemoteInputChannel ch = InputChannelTestUtils.createRemoteInputChannel(gate, 0, connManager);
ch.onError(new ProducerFailedException(new RuntimeException("Expected test exception.")));
ch.requestSubpartition();
// Should throw an instance of CancelTaskException.
ch.getNextBuffer();
}
Aggregations