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. (opensearch-project#4723)

Signed-off-by: David Venable <dlv@amazon.com>
Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>
  • Loading branch information
dlvenable authored and Krishna Kondaka committed Jul 23, 2024
1 parent ae3470e commit e0bfb72
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 e0bfb72

Please sign in to comment.