rehevkor5 commented on a change in pull request #7672: [FLINK-11568][kinesis] Don't obscure important Kinesis exceptions URL: https://github.com/apache/flink/pull/7672#discussion_r255585813
########## File path: flink-connectors/flink-connector-kinesis/src/test/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcherTest.java ########## @@ -811,4 +818,63 @@ protected long getCurrentTimeMillis() { Assert.assertTrue("idle, no watermark", watermarks.isEmpty()); } + @Test + public void testOriginalExceptionIsPreservedWhenInterruptedDuringShutdown() throws Exception { + final String stream = "fakeStream"; + + Map<String, List<BlockingQueue<String>>> streamsToShardQueues = new HashMap<>(); + final LinkedBlockingQueue<String> queue = new LinkedBlockingQueue<>(10); + queue.put("item1"); + streamsToShardQueues.put(stream, Collections.singletonList(queue)); + + final AlwaysThrowsDeserializationSchema deserializationSchema = new AlwaysThrowsDeserializationSchema(); + final KinesisProxyInterface fakeKinesis = + FakeKinesisBehavioursFactory.blockingQueueGetRecords(streamsToShardQueues); + + final TestableKinesisDataFetcherForShardConsumerException<String> fetcher = new TestableKinesisDataFetcherForShardConsumerException<>( + Collections.singletonList(stream), + new TestSourceContext<>(), + TestUtils.getStandardProperties(), + new KinesisDeserializationSchemaWrapper<>(deserializationSchema), + 10, + 2, + new AtomicReference<>(), + new LinkedList<>(), + new HashMap<>(), + fakeKinesis); + + final DummyFlinkKinesisConsumer<String> consumer = new DummyFlinkKinesisConsumer<>( Review comment: My IDE automatically marks things `final` wherever possible, to prevent writing accidental mutable code, but I will happily remove them. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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