Skip to content

Fix RumSessionEnded metric flaky test#2114

Merged
ambushwork merged 1 commit into
developfrom
yl/fix-rum-session-ended-flanky-test
Jun 28, 2024
Merged

Fix RumSessionEnded metric flaky test#2114
ambushwork merged 1 commit into
developfrom
yl/fix-rum-session-ended-flanky-test

Conversation

@ambushwork

Copy link
Copy Markdown
Member

What does this PR do?

Fix the min boundary of generating the int for unit test.

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)

@ambushwork
ambushwork requested review from a team as code owners June 28, 2024 07:32
@codecov-commenter

codecov-commenter commented Jun 28, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.67%. Comparing base (d2a5741) to head (15e7882).
Report is 13 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2114      +/-   ##
===========================================
- Coverage    69.84%   69.67%   -0.17%     
===========================================
  Files          715      715              
  Lines        26577    26590      +13     
  Branches      4457     4458       +1     
===========================================
- Hits         18561    18525      -36     
- Misses        6821     6838      +17     
- Partials      1195     1227      +32     

see 28 files with indirect coverage changes

@ambushwork
ambushwork force-pushed the yl/fix-rum-session-ended-flanky-test branch from e486199 to 15e7882 Compare June 28, 2024 08:48
val sessionEndedMetric =
SessionEndedMetric(fakeSessionId, fakeStartReason, fakeNtpOffsetAtStart, backgroundEventTracking)
val backgroundViewCount = forge.anInt(min = 1, max = events.size)
val backgroundViewCount = forge.anInt(min = 1, max = events.size + 1)

@mariusc83 mariusc83 Jun 28, 2024

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.

is there any possibility that events.size ==0 ? In that case that function will throw a RuntimeException.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

as @0xnm explained, @Forgery events: List<ViewEvent> will not generate empty list, and I made some pressure test with 500 repeats, I didn't see any exception on that.

@ambushwork
ambushwork merged commit 2b579f8 into develop Jun 28, 2024
@ambushwork
ambushwork deleted the yl/fix-rum-session-ended-flanky-test branch June 28, 2024 11:11
@xgouchet xgouchet added this to the 2.12.x milestone Jul 31, 2024
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.

5 participants