Skip to content

Fix flaky PipelinesWithAcksIT by awaiting async ack callback#6718

Open
lawofcycles wants to merge 1 commit intoopensearch-project:mainfrom
lawofcycles:fix/flaky-pipelines-with-acks-it
Open

Fix flaky PipelinesWithAcksIT by awaiting async ack callback#6718
lawofcycles wants to merge 1 commit intoopensearch-project:mainfrom
lawofcycles:fix/flaky-pipelines-with-acks-it

Conversation

@lawofcycles
Copy link
Copy Markdown
Contributor

@lawofcycles lawofcycles commented Apr 3, 2026

Description

Fix flaky PipelinesWithAcksIT tests that intermittently fail with NullPointerException.

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 causes getAckReceived() to return null, which triggers a NullPointerException when unboxed by assertTrue(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 in three_pipelines_with_all_unrouted_records().

CI impact

This fix targets the Gradle Build / build workflow (gradle.yml), which runs ./gradlew build including :data-prepper-core:integrationTest. The following test methods in PipelinesWithAcksIT have been observed to fail intermittently across Java 11, 17, and 21 matrix jobs.

Local verification (10 consecutive runs each):

  • Before: 8/10 passed (2 failures)
  • After: 10/10 passed (0 failures)

Issues Resolved

Related #3481

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

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>
@lawofcycles
Copy link
Copy Markdown
Contributor Author

lawofcycles commented Apr 3, 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