Skip to content

Fix flaky DynamoDB enhanced client integration tests - #7344

Open
S-Saranya1 wants to merge 1 commit into
masterfrom
somepal/fix-flaky-search-vectors-tests
Open

Fix flaky DynamoDB enhanced client integration tests#7344
S-Saranya1 wants to merge 1 commit into
masterfrom
somepal/fix-flaky-search-vectors-tests

Conversation

@S-Saranya1

@S-Saranya1 S-Saranya1 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

Several DynamoDB enhanced client integration tests flake in preview builds due to eventual consistency:

  • SearchVectorsIntegrationTestBase (SearchHappyPathTests): Fails with No result with sort key: dot-unbounded-item because POST_MUTATION_SEARCH_RETRY_ATTEMPTS (8 retries, ~4.5s) was insufficient for vector index propagation under CI load.

  • SearchVectorsIntegrationTestBase (WritePathTests): writePath_updateNonVectorFieldsOnly fails at ~0.026s because searchVectorsUntilContains checks item presence but not content, returning immediately with stale data after an update.

  • QueryGSICompositeKeysIntegrationTest (Static, Immutable, Bean schemas): Various queryGsi* tests fail because waitForGsiConsistency() used a fixed 3-second Thread.sleep, which is insufficient for GSI propagation under CI load. 43 failure runs in the last 30 days.

Modifications

  • Removed POST_MUTATION_SEARCH_RETRY_ATTEMPTS and consolidated into DEFAULT_SEARCH_RETRY_ATTEMPTS (15), since post-mutation searches need the same consistency window.
  • Added content-aware retry in writePath_updateNonVectorFieldsOnly to wait for the updated description to propagate, not just item presence.
  • Replaced fixed Thread.sleep(3000) in waitForGsiConsistency() with a poll-and-retry loop that scans gsi1 until all records are visible, with exponential backoff (500ms-2s, up to 20 attempts).

Testing

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@S-Saranya1
S-Saranya1 requested a review from a team as a code owner September 3, 2026 00:09
@S-Saranya1
S-Saranya1 force-pushed the somepal/fix-flaky-search-vectors-tests branch from afe9181 to 8af8a33 Compare September 4, 2026 20:54
@S-Saranya1 S-Saranya1 changed the title Fix flaky DynamoDB enhanced client integration tests Fix flaky DynamoDB enhanced client flaky integration tests Sep 4, 2026
@S-Saranya1
S-Saranya1 requested a review from RanVaknin September 4, 2026 21:03
@S-Saranya1 S-Saranya1 changed the title Fix flaky DynamoDB enhanced client flaky integration tests Fix flaky DynamoDB enhanced client integration tests Sep 4, 2026
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.

1 participant