Skip to content

Fix flaky tests in OtelTraceWriter#2571

Merged
jonathanmos merged 1 commit into
developfrom
jmoskovich/fix-flaky-otel-test
Mar 31, 2025
Merged

Fix flaky tests in OtelTraceWriter#2571
jonathanmos merged 1 commit into
developfrom
jmoskovich/fix-flaky-otel-test

Conversation

@jonathanmos

@jonathanmos jonathanmos commented Mar 28, 2025

Copy link
Copy Markdown
Member

What does this PR do?

Some tests in the OtelTraceWriter are flaky because of the method used to generate lists of DDSpans. In some cases, all the elements of the list can be filtered out leaving empty lists, and this causes the tests to fail.

Solution: ensure the list of spans generated by the tests is not empty.

Motivation

Flakiness noticed in the tests.

Additional Notes

Anything else we should know when reviewing?

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@jonathanmos
jonathanmos force-pushed the jmoskovich/fix-flaky-otel-test branch from 40f02d4 to b37fe3e Compare March 28, 2025 11:49
@codecov-commenter

codecov-commenter commented Mar 28, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.18%. Comparing base (245c50a) to head (6ecc107).
Report is 226 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2571      +/-   ##
===========================================
+ Coverage    70.14%   70.18%   +0.04%     
===========================================
  Files          803      803              
  Lines        30146    30146              
  Branches      5046     5046              
===========================================
+ Hits         21145    21157      +12     
- Misses        7600     7602       +2     
+ Partials      1401     1387      -14     

see 24 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jonathanmos
jonathanmos marked this pull request as ready for review March 28, 2025 13:06
@jonathanmos
jonathanmos requested review from a team as code owners March 28, 2025 13:06
0xnm
0xnm previously approved these changes Mar 28, 2025
Comment on lines +317 to +321
var spans = emptyList<DDSpan>()
while (spans.isEmpty()) {
spans = forge.aList { getForgery<DDSpan>() }
.filter(predicate)
}

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.

we can also use approach which @aleksandr-gringauz did in #2565 (there it is a bit more flexible), but here it is also okay

@jonathanmos
jonathanmos merged commit 8464f0f into develop Mar 31, 2025
@jonathanmos
jonathanmos deleted the jmoskovich/fix-flaky-otel-test branch March 31, 2025 09:46
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