EugeneYushin 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_r255416933
##########
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:
What is the reason to keep this field (and few above) as `final`? I don't
have any concerns other than it's test code which we fully control and it's
better to keep it concise for the sake of read-ability.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services