diff --git a/data-prepper-plugins/s3-source/src/integrationTest/java/org/opensearch/dataprepper/plugins/source/SqsWorkerIT.java b/data-prepper-plugins/s3-source/src/integrationTest/java/org/opensearch/dataprepper/plugins/source/SqsWorkerIT.java index 9c55f9ce5f..23c365ec45 100644 --- a/data-prepper-plugins/s3-source/src/integrationTest/java/org/opensearch/dataprepper/plugins/source/SqsWorkerIT.java +++ b/data-prepper-plugins/s3-source/src/integrationTest/java/org/opensearch/dataprepper/plugins/source/SqsWorkerIT.java @@ -149,7 +149,7 @@ void processSqsMessages_should_return_at_least_one_message(final int numberOfObj @ParameterizedTest @ValueSource(ints = {1}) - void processSqsMessages_should_return_at_least_one_message_with_acks_with_callback_invoked_after_processS3Object_finishes(final int numberOfObjectsToWrite) throws IOException { + void processSqsMessages_should_return_at_least_one_message_with_acks_with_callback_invoked_after_processS3Object_finishes(final int numberOfObjectsToWrite) throws IOException, InterruptedException { writeToS3(numberOfObjectsToWrite); when(s3SourceConfig.getAcknowledgements()).thenReturn(true); @@ -205,9 +205,7 @@ void processSqsMessages_should_return_at_least_one_message_with_acks_with_callba ready.set(true); this.notify(); } - try { - Thread.sleep(10000); - } catch (Exception e){} + Thread.sleep(10000); assertThat(deletedCount, equalTo((double)1.0)); assertThat(ackCallbackCount, equalTo((double)1.0)); @@ -215,7 +213,7 @@ void processSqsMessages_should_return_at_least_one_message_with_acks_with_callba @ParameterizedTest @ValueSource(ints = {1}) - void processSqsMessages_should_return_at_least_one_message_with_acks_with_callback_invoked_before_processS3Object_finishes(final int numberOfObjectsToWrite) throws IOException { + void processSqsMessages_should_return_at_least_one_message_with_acks_with_callback_invoked_before_processS3Object_finishes(final int numberOfObjectsToWrite) throws IOException, InterruptedException { writeToS3(numberOfObjectsToWrite); when(s3SourceConfig.getAcknowledgements()).thenReturn(true); @@ -277,10 +275,7 @@ void processSqsMessages_should_return_at_least_one_message_with_acks_with_callba sinkThread.start(); final int sqsMessagesProcessed = objectUnderTest.processSqsMessages(); - try { - Thread.sleep(10000); - } catch (Exception e){} - + Thread.sleep(10000); assertThat(deletedCount, equalTo((double)1.0)); assertThat(ackCallbackCount, equalTo((double)1.0));