Skip to content

Conversation

@san81
Copy link
Collaborator

@san81 san81 commented Dec 10, 2025

Description

Fixing two failing tests:

  • Jira and Confluence host name change to fix the failing tests
  • We need to explicitly build the RetryPolicy object instead of using the consumer pattern when using "ADAPTIVE_V2". This api is also marked as depecreated and expected to be replaced by RetryStrategy but thats a bigger exercise we will take up clean up all RetryPolicy occurrences together.
  • Fix OutOfMemoryError in CloudWatchLogsServiceTest by replacing String.repeat() with RandomStringUtils.randomAlphabetic() to generate test data of correct size (25MB)
    instead of excessive repetitions (~288GB)
  • Date format validation fix randomly failing when UUID string generates a string that actually passes Date format validation. Removed UUID usage here. Made the test more reliable
  • Added Await-ability for more consistent validation in the DDB source coordination test

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
…_V2 retry mode and requires using RetryStrategy instead.

Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
@san81 san81 changed the title Confluence host name change to fix the failing tests Confluence and CloudWatch failing tests fix Dec 10, 2025
san81 added 8 commits December 9, 2025 17:27
….repeat() with RandomStringUtils.randomAlphabetic() to generate test data of correct size (25MB)

   instead of excessive repetitions (~288GB)

Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
….repeat() with RandomStringUtils.randomAlphabetic() to generate test data of correct size (25MB)

   instead of excessive repetitions (~288GB)

Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
…or instances to be registered:

Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
@san81 san81 changed the title Confluence and CloudWatch failing tests fix Confluence and CloudWatch and multiple other failing tests fix Dec 10, 2025
graytaylor0
graytaylor0 previously approved these changes Dec 10, 2025
Copy link
Member

@graytaylor0 graytaylor0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all these fixes!

Copy link
Member

@dlvenable dlvenable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for these changes!

final Optional<SourcePartitionStoreItem> maybeAcquired =
objectUnderTest.tryAcquireAvailablePartition(sourceIdentifier, ownerId, Duration.ofSeconds(20));
// Wait for partition to be available in DynamoDB Local before attempting to acquire
final Optional<SourcePartitionStoreItem>[] maybeAcquiredHolder = new Optional[]{Optional.empty()};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this will actually fix the issue. I've tried this a few times and ended up disabling this test in #6328.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still some sleep in that PR, which could add uncertainty. I am hoping, we can give it a try with this approach and see.

void testValidAndInvalidOutputFormats() throws NoSuchFieldException, IllegalAccessException {
setField(DateProcessorConfig.class, dateProcessorConfig, "outputFormat", random);
// Use a string with invalid pattern characters (] and [ are reserved and will always fail)
setField(DateProcessorConfig.class, dateProcessorConfig, "outputFormat", "invalid[pattern]format");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably an @ParameterizedTest with a few different invalid formats provided.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, converted it now.
Thought of minimizing the changes but as I am touching this, I could as well do it 👍


final ClientOverrideConfiguration.Builder configBuilder = ClientOverrideConfiguration.builder()
.retryPolicy(r -> r.numRetries(AwsConfig.DEFAULT_CONNECTION_ATTEMPTS));
.retryPolicy(retryPolicy);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why this improves the tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, it started with AWS SDK behavior/validation changes that made the consumer pattern incompatible with the default retry mode. They now changed the default retry mode to be ADAPTIVE_V2

https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/retry-strategy.html

Ideal fix is to move to using RetryStrategy but thats a bigger change so minimized the changes here by avoiding using the consumer pattern. https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/retries/api/RetryStrategy.html

for (int i = 0; i < thresholdConfig.getBatchSize(); i++) {
JacksonEvent mockJacksonEvent = (JacksonEvent) JacksonEvent.fromMessage("testMessage".repeat((int) thresholdConfig.getMaxEventSizeBytes()));
JacksonEvent mockJacksonEvent =
(JacksonEvent) JacksonEvent.fromMessage(RandomStringUtils.insecure().nextAlphabetic(messageSize));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why the repeat used so much memory?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. It was because the original string was already long.

Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
Copy link
Member

@dlvenable dlvenable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @san81 !

@san81 san81 merged commit 442cd70 into opensearch-project:main Dec 10, 2025
45 of 47 checks passed
eatulban pushed a commit to eatulban/data-prepper that referenced this pull request Dec 11, 2025
…earch-project#6348)

Making the tests less flaky. More reliable. Avoiding possible Out of memory issue with large pay load generation.
wandna-amazon pushed a commit to wandna-amazon/data-prepper that referenced this pull request Jan 8, 2026
…earch-project#6348)

Making the tests less flaky. More reliable. Avoiding possible Out of memory issue with large pay load generation.

Signed-off-by: Nathan Wand <wandna@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants