bitwarden / ios

Bitwarden mobile app for iOS.
https://bitwarden.com
GNU General Public License v3.0
199 stars 25 forks source link

PM-11430: Fix policy service intermittent test failures #877

Closed matt-livefront closed 2 months ago

matt-livefront commented 2 months ago

🎟ī¸ Tracking

PM-11430

📔 Objective

This policy service test was added to ensure that simultaneous access to the shared dictionary doesn't crash the app. However, it was also asserting that we only fetch the user's policies from the database once. This was causing occasional test failures. I don't think we can make this assertion though; an actor will ensure the shared state isn't accessed simultaneous from multiple threads, but it isn't going to serialize calls to the policiesForUser method. I don't think we need to guarantee that the policies are only fetched once, so I removed this assertion. I also changed the test to run multiple times to prevent a false positive from causing the test to succeed.

⏰ Reminders before review

đŸĻŽ Reviewer guidelines

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.70%. Comparing base (f5e184f) to head (85861cf). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #877 +/- ## ======================================= Coverage 88.70% 88.70% ======================================= Files 617 617 Lines 30804 30804 ======================================= Hits 27326 27326 Misses 3478 3478 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 2 months ago

Logo Checkmarx One – Scan Summary & Details – c3b533ab-5978-4b49-9922-e9fb9c2ed2a4

No New Or Fixed Issues Found