tests: fix spurious failure of stats tests
Some of the test_stats tests would fail occasionally with the wrong queue length. Traced it back to the redis 'Queue' object somehow persisting across tests. We now ensure that a fresh queue is used for each test.
Second push includes the changes I made to test_stats.py to chase this down, specifically adds assertions to ensure that the queues are empty before doing anything else.
Also incorporates a bunch of cleanup to make the test cases much more readable.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 90.93%. Comparing base (5e65dec) to head (08d4698).
:warning: Report is 281 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #1051 +/- ##
===========================================
+ Coverage 80.75% 90.93% +10.17%
===========================================
Files 15 14 -1
Lines 977 1147 +170
===========================================
+ Hits 789 1043 +254
+ Misses 188 104 -84
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.