Skip to content

Fix flaky test#2412

Merged
xgouchet merged 1 commit into
developfrom
xgouchet/flaky_deterministic_tests
Nov 22, 2024
Merged

Fix flaky test#2412
xgouchet merged 1 commit into
developfrom
xgouchet/flaky_deterministic_tests

Conversation

@xgouchet

Copy link
Copy Markdown
Contributor

No description provided.

@xgouchet
xgouchet requested review from a team as code owners November 22, 2024 09:43
@codecov-commenter

codecov-commenter commented Nov 22, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.88%. Comparing base (47ccfcf) to head (e964187).
Report is 8 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2412      +/-   ##
===========================================
+ Coverage    69.86%   69.88%   +0.02%     
===========================================
  Files          766      766              
  Lines        28483    28483              
  Branches      4778     4778              
===========================================
+ Hits         19898    19904       +6     
+ Misses        7264     7260       -4     
+ Partials      1321     1319       -2     

see 26 files with indirect coverage changes

---- 🚨 Try these New Features:

@FloatForgery(min = 0f, max = 100f) fakeSampleRate: Float
) {
// Given
println("fakeTraceIds.size: ${fakeTraceIds.size}")

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.

Should this log be kept?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed we can remove it

// Then
assertThat(sampledIn.toFloat()).isCloseTo(traceIds.size * fakeSampleRate / 100f, Offset.offset(7.5f))
val offset = 2.5f * fakeTraceIds.size
assertThat(sampledIn.toFloat()).isCloseTo(fakeTraceIds.size * fakeSampleRate / 100f, Offset.offset(offset))

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.

Note:

This might reduce the chance of flakiness, but can't completely avoid the test fail in my opinion
Let's keep it this way and see if it still fails

@xgouchet
xgouchet force-pushed the xgouchet/flaky_deterministic_tests branch from eebd094 to e964187 Compare November 22, 2024 14:16
@xgouchet
xgouchet merged commit a67406e into develop Nov 22, 2024
@xgouchet
xgouchet deleted the xgouchet/flaky_deterministic_tests branch November 22, 2024 15:45
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.

4 participants