suneet-s commented on a change in pull request #10761: URL: https://github.com/apache/druid/pull/10761#discussion_r558549231
########## File path: extensions-core/kinesis-indexing-service/src/test/java/org/apache/druid/indexing/kinesis/KinesisRecordSupplierTest.java ########## @@ -410,6 +414,53 @@ public void testPollWithKinesisInternalFailure() throws InterruptedException Assert.assertEquals(SHARDS_LAG_MILLIS, recordSupplier.getPartitionResourcesTimeLag()); } + @Test + public void testRecoverableException_IOException() + { + Assert.assertTrue(KinesisRecordSupplier.isClientExceptionRecoverable(new AmazonClientException(new IOException()))); + } + + @Test + public void testRecoverableException_RequestTimeout() + { + AmazonServiceException ex = new AmazonServiceException(null); + ex.setErrorCode("RequestTimeout"); + Assert.assertTrue(KinesisRecordSupplier.isClientExceptionRecoverable(ex)); + } + + @Test + public void testRecoverableException_500() + { + AmazonServiceException ex = new AmazonServiceException(null); + ex.setStatusCode(500); + Assert.assertTrue(KinesisRecordSupplier.isClientExceptionRecoverable(ex)); + } + + @Test + public void testRecoverableException_502() + { + AmazonServiceException ex = new AmazonServiceException(null); + ex.setStatusCode(502); + Assert.assertTrue(KinesisRecordSupplier.isClientExceptionRecoverable(ex)); + } + + @Test + public void testRecoverableException_503() + { + AmazonServiceException ex = new AmazonServiceException(null); + ex.setStatusCode(503); + Assert.assertTrue(KinesisRecordSupplier.isClientExceptionRecoverable(ex)); + } + + @Test + public void testRecoverableException_ProvisionedThroughputExceededException() + { + AmazonServiceException ex = new AmazonServiceException(null); + ex.setErrorCode("ProvisionedThroughputExceededException"); + Assert.assertTrue(KinesisRecordSupplier.isClientExceptionRecoverable(ex)); + } + + Review comment: Could you add tests for `ClockSkewError` and non-recoverable exceptions as well please ---------------------------------------------------------------- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org