Fix flaky Data Streams assertions in HTTP tests#11916
Open
AlexeyKuznetsov-DD wants to merge 2 commits into
Open
Fix flaky Data Streams assertions in HTTP tests#11916AlexeyKuznetsov-DD wants to merge 2 commits into
AlexeyKuznetsov-DD wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
More details
PR eliminates test flakiness by adding waitForGroup() to properly wait for asynchronous Data Streams group arrival before assertions. Implementation correctly synchronizes access, respects timeouts, and returns matching groups. All 47 test migrations are consistent and safe. No behavioral regressions detected.
📊 Validated against 5 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit bc39012 · What is Autotest? · Any feedback? Reach out in #autotest
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.
What Does This Do
Adds
waitForGrouptoRecordingDatastreamsPayloadWriterand uses it in the shared HTTP tests to wait for the expected rootStatsGroupbefore callingverifyAll.Note: Test changed a lot of places, but they all identical.
Motivation
These tests were flaky on GitLab CI because Data Streams groups are reported asynchronously.
waitForGroups(1)only guaranteed that any group existed, so the immediategroups.find { it.parentHash == 0 }could returnnullbefore the expected root group arrived. A Develocity retry could pass with a more favorable scheduling order.waitForGroupwaits for the matching group with a bounded timeout, removing that race and producing a clearer failure if the group never arrives.Additional Notes
Before the fix tests failed on GitLab Ci:
Verification:
RecordingDatastreamsPayloadWriterTest.