-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix SeekBarWireframeMapper flaky test #2308
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2308 +/- ##
===========================================
- Coverage 70.32% 70.28% -0.05%
===========================================
Files 736 736
Lines 27466 27466
Branches 4607 4607
===========================================
- Hits 19315 19302 -13
+ Misses 6871 6868 -3
- Partials 1280 1296 +16 |
Thanks for the explanation @ambushwork, but I still feel I'm not getting it, especially this part:
Can you give a concrete example where it leads to the test failure? |
@0xnm yes, so if the test runs under previous code,
In the function
which returns so we can see there is already a difference between |
@ambushwork I have the feeling that even with this change test may be flaky, just the probability will be much lower, but let's see. |
...lin/com/datadog/android/sessionreplay/internal/recorder/mapper/SeekBarWireframeMapperTest.kt
Outdated
Show resolved
Hide resolved
2825f0b
to
2a03b54
Compare
yes, that's correct, with original code the chance of failure is kind like 1 in 2000, with the fix I think it can be reduced about 100 times, which I think it's acceptable. |
What does this PR do?
The main cause is that
fakeProgress
has random value such as0.00001
, which loses some precision when convert to Int and convert back to float, sofakeProgressInt
from 0~100 limit only two decimal .Review checklist (to be filled by reviewers)