Skip to content

Commit

Permalink
Updates to the AWS Lambda Sink tests to fix a flaky test. Also adds S…
Browse files Browse the repository at this point in the history
…LF4J logging for these tests. (#4723)

Signed-off-by: David Venable <[email protected]>
  • Loading branch information
dlvenable authored Jul 11, 2024
1 parent 782ad51 commit 5420162
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions data-prepper-plugins/lambda/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies {
testImplementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
testImplementation project(':data-prepper-test-common')
testImplementation project(':data-prepper-plugins:parse-json-processor')
testImplementation testLibs.slf4j.simple
}

test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public void lambda_sink_test_batch_enabled() throws IOException {
when(lambdaSinkConfig.getBatchOptions()).thenReturn(mock(BatchOptions.class));
when(lambdaSinkConfig.getBatchOptions().getBatchKey()).thenReturn(batchKey);
when(lambdaSinkConfig.getBatchOptions().getThresholdOptions()).thenReturn(mock(ThresholdOptions.class));
when(lambdaSinkConfig.getBatchOptions().getThresholdOptions().getEventCount()).thenReturn(maxEvents);
when(lambdaSinkConfig.getBatchOptions().getThresholdOptions().getEventCount()).thenReturn(1);
when(lambdaSinkConfig.getBatchOptions().getThresholdOptions().getMaximumSize()).thenReturn(ByteCount.parse(maxSize));
when(lambdaSinkConfig.getBatchOptions().getThresholdOptions().getEventCollectTimeOut()).thenReturn(Duration.ofNanos(10L));
when(lambdaSinkConfig.getAwsAuthenticationOptions()).thenReturn(mock(AwsAuthenticationOptions.class));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright OpenSearch Contributors
# SPDX-License-Identifier: Apache-2.0
#

org.slf4j.simpleLogger.showDateTime=true
org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd' 'HH:mm:ss.SSS
org.slf4j.simpleLogger.log.org.opensearch.dataprepper.plugins.lambda.sink=trace

0 comments on commit 5420162

Please sign in to comment.