From e8455cfc1a591af578443a5d3a8d254ff6e36a75 Mon Sep 17 00:00:00 2001 From: Krishna Kondaka Date: Thu, 2 Nov 2023 19:21:26 +0000 Subject: [PATCH] Fix sqs worker integration test failure Signed-off-by: Krishna Kondaka --- .../dataprepper/plugins/source/s3/SqsWorkerIT.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/data-prepper-plugins/s3-source/src/integrationTest/java/org/opensearch/dataprepper/plugins/source/s3/SqsWorkerIT.java b/data-prepper-plugins/s3-source/src/integrationTest/java/org/opensearch/dataprepper/plugins/source/s3/SqsWorkerIT.java index 49dfa38ae7..58a4be9182 100644 --- a/data-prepper-plugins/s3-source/src/integrationTest/java/org/opensearch/dataprepper/plugins/source/s3/SqsWorkerIT.java +++ b/data-prepper-plugins/s3-source/src/integrationTest/java/org/opensearch/dataprepper/plugins/source/s3/SqsWorkerIT.java @@ -312,7 +312,7 @@ void processSqsMessages_with_acks_and_progress_check_callbacks(final int numberO lenient().doAnswer((val) -> { if (val.getArgument(0) != null) { - delCount.getAndAdd((int)(double)val.getArgument(0)); + deletedCount += (double)val.getArgument(0); } return null; }).when(deletedCounter).increment(any(Double.class)); @@ -360,7 +360,7 @@ void processSqsMessages_with_acks_and_progress_check_callbacks(final int numberO await().atMost(Duration.ofSeconds(20)) .untilAsserted(() -> { assertThat(visibilityTimeoutChangedCount, greaterThanOrEqualTo((double)numberOfObjectsToWrite)); - assertThat(delCount.get(), equalTo(numberOfObjectsToWrite)); + assertThat(deletedCount, equalTo((double)numberOfObjectsToWrite)); assertThat(ackCallbackCount, equalTo((double)numberOfObjectsToWrite)); }); } @@ -387,7 +387,6 @@ void processSqsMessages_with_acks_and_progress_check_callbacks_expires(final int lenient().doAnswer((val) -> { if (val.getArgument(0) != null) { deletedCount += (double)val.getArgument(0); - delCount.getAndAdd((int)(double)val.getArgument(0)); } return null; }).when(deletedCounter).increment(any(Double.class)); @@ -429,7 +428,7 @@ void processSqsMessages_with_acks_and_progress_check_callbacks_expires(final int await().atMost(Duration.ofSeconds(10)) .untilAsserted(() -> { assertThat(visibilityTimeoutChangedCount, greaterThanOrEqualTo((double)numberOfObjectsToWrite)); - assertThat(delCount.get(), equalTo(0)); + assertThat(deletedCount, equalTo(0.0)); assertThat(ackCallbackCount, equalTo(0.0)); });