Skip to content

Shbikram/de conflict tests#2207

Merged
sharmabikram merged 5 commits into
mainfrom
shbikram/deConflictTests
Apr 13, 2026
Merged

Shbikram/de conflict tests#2207
sharmabikram merged 5 commits into
mainfrom
shbikram/deConflictTests

Conversation

@sharmabikram

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@sharmabikram sharmabikram requested a review from a team as a code owner April 10, 2026 21:05
* Example: "rawEcdhKeyringItem" becomes "rawEcdhKeyringItem-482913"
*/
public static String uniquePk(String base) {
return base + "-" + TEST_PREFIX;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: variable says prefix but this is suffix

assertNotNull(ase.getErrorCode());
assertNotNull(ase.getErrorType());
assertNotNull(ase.getMessage());
} catch (java.util.concurrent.RejectedExecutionException e) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I prefer to let it fail for visibility of the failure

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What are we gaining from this visibility apart from having to retry? Is there any action item on failure?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is RejectedExecutionException expected failure from this test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. In parallel run two threads are scheduled to make call to DDB. If first one fails before other thread is even submitted, the executor shuts down and second submit fails leading to RejectedExecutionException.

Since this is a failure scenario, the first thread will always fail. In that case, it depends on whether the second thread is scheduled or not which is out of our control.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

praise: just having random PK will largely reduce flaky test.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like that partition key is random which will reduce flaky CI. This will end up creating huge DDB. So, we should put clean up code to remove the item created by examples. I would send the pk name from test then add clean up code in test to keep actual examples clean.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are multiple solutions to clean up.
But for now, I think we punt that issue, and accept these changes.
Addressing CI clean up is an issue best left for another day.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Let me attempt a afterClass in each file. If that takes too long, we can park that and come back with another cleanup story.

@rishav-karanjit

Copy link
Copy Markdown
Member

You might want to change PR title

texastony
texastony previously approved these changes Apr 13, 2026
*/
public class ExampleUtils {

private static final String TEST_PREFIX = String.valueOf(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
private static final String TEST_PREFIX = String.valueOf(
private static final String TEST_SUFFIX = String.valueOf(

* Example: "rawEcdhKeyringItem" becomes "rawEcdhKeyringItem-482913"
*/
public static String uniquePk(String base) {
return base + "-" + TEST_PREFIX;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
return base + "-" + TEST_PREFIX;
return base + "-" + TEST_SUFFIX;

import java.util.concurrent.ThreadLocalRandom;

/**
* Shared utilities for examples. The TEST_PREFIX provides a unique suffix

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Shared utilities for examples. The TEST_PREFIX provides a unique suffix
* Shared utilities for examples. The TEST_SUFFIX provides a unique suffix

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are multiple solutions to clean up.
But for now, I think we punt that issue, and accept these changes.
Addressing CI clean up is an issue best left for another day.

@sharmabikram sharmabikram merged commit f0ff282 into main Apr 13, 2026
126 of 128 checks passed
rishav-karanjit pushed a commit that referenced this pull request Apr 13, 2026
* chore(java): deconflicts the test run across various Java and OS versions

* chore(java): attempts to deconflict tests across different java and OS versions

* chore(java): fixing bugs in test scenario leading to failures

* chore(java): fixes format issue and also addressing ddb parallel test run failure

* chore(java): Adds afterTest cleanup method to clean DDB items created in test run
rishav-karanjit pushed a commit that referenced this pull request Apr 13, 2026
* chore(java): deconflicts the test run across various Java and OS versions

* chore(java): attempts to deconflict tests across different java and OS versions

* chore(java): fixing bugs in test scenario leading to failures

* chore(java): fixes format issue and also addressing ddb parallel test run failure

* chore(java): Adds afterTest cleanup method to clean DDB items created in test run
@sharmabikram sharmabikram deleted the shbikram/deConflictTests branch April 13, 2026 23:18
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