🐛 Stabilize flaky auth decorator overhead test by using high-resolution timing and safe ratio calculation#9041
Conversation
|
There was a problem hiding this comment.
Pull request overview
Stabilizes a flaky performance-overhead unit test in the webserver security tests by switching to a higher-resolution monotonic timer and making the diagnostic ratio computation resilient to zero/near-zero baselines.
Changes:
- Replace event-loop timing with
time.perf_counter_ns()for higher-resolution measurements. - Update median/ratio diagnostics to use nanoseconds and avoid division-by-zero in debug output.
- Keep the existing overhead assertion intent (admin handler vs public handler baseline).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9041 +/- ##
==========================================
- Coverage 87.35% 82.77% -4.59%
==========================================
Files 2056 792 -1264
Lines 80971 36980 -43991
Branches 1451 182 -1269
==========================================
- Hits 70731 30609 -40122
+ Misses 9829 6321 -3508
+ Partials 411 50 -361
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
@Mergifyio queue |
Merge Queue Status🛑 Queue command has been cancelled |
Merge Queue Status
This pull request spent 11 seconds in the queue, including 1 second running CI. Required conditions to merge
|



What do these changes do?
This PR fixes a flaky unit test in test_security_web.py, specifically test_time_overhead_on_handlers_of_auth_decorators.
Root cause:
What changed:
Impact:
Related issue/s
How to test
Dev-ops