Fix flaky PipelinesWithAcksIT by awaiting async ack callback#6718
Open
lawofcycles wants to merge 1 commit intoopensearch-project:mainfrom
Open
Fix flaky PipelinesWithAcksIT by awaiting async ack callback#6718lawofcycles wants to merge 1 commit intoopensearch-project:mainfrom
lawofcycles wants to merge 1 commit intoopensearch-project:mainfrom
Conversation
The acknowledgement callback is invoked asynchronously after sink processing completes. Tests were asserting the ack result immediately after confirming sink output, causing intermittent NullPointerException when the callback had not yet fired. Wrap ack assertions in await().untilAsserted() to poll until the callback completes, matching the pattern already used in three_pipelines_with_all_unrouted_records(). Signed-off-by: Sotaro Hikita <bering1814@gmail.com>
Contributor
Author
|
I found another flaky test: https://github.com/opensearch-project/data-prepper/actions/runs/23929544444/job/69793605060?pr=6718 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix flaky
PipelinesWithAcksITtests that intermittently fail withNullPointerException.The acknowledgement callback (
setAckReceived) is invoked asynchronously after sink processing completes. The existing tests assert the ack result immediately after confirming sink output arrival, without waiting for the async callback. Under CI load, this race condition causesgetAckReceived()to returnnull, which triggers aNullPointerExceptionwhen unboxed byassertTrue(Boolean).This change wraps all ack assertions in
await().untilAsserted()to poll until the acknowledgement callback has been invoked, consistent with the existing pattern already used inthree_pipelines_with_all_unrouted_records().CI impact
This fix targets the
Gradle Build / buildworkflow (gradle.yml), which runs./gradlew buildincluding:data-prepper-core:integrationTest. The following test methods inPipelinesWithAcksIThave been observed to fail intermittently across Java 11, 17, and 21 matrix jobs.Local verification (10 consecutive runs each):
Issues Resolved
Related #3481
Check List