Skip to content
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

tests: fix spurious failure of stats tests #1051

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

efahl
Copy link
Contributor

@efahl efahl commented Oct 23, 2024

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.

@efahl
Copy link
Contributor Author

efahl commented Oct 23, 2024

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.

Copy link

codecov bot commented Oct 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.93%. Comparing base (5e65dec) to head (08d4698).
Report is 139 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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Signed-off-by: Eric Fahlgren <[email protected]>
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.

1 participant