test: widen safety margin in test_response_aggregation_timings_multiple#1737
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1737 +/- ##
=======================================
Coverage 99.76% 99.76%
=======================================
Files 33 33
Lines 3440 3440
Branches 473 473
=======================================
Hits 3432 3432
Misses 5 5
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@bluetoothbot review |
PR Review — test: widen safety margin in test_response_aggregation_timings_multipleTargeted, well-reasoned fix for a Windows-CI flake. Math is internally consistent: the new pre-assertion gap below the 1020ms minimum widens from ~100ms to ~520ms (well clear of Windows' ~15.6ms default timer resolution), and the second sleep is rebalanced so the total elapsed time remains 1340ms — preserving the headroom of the assert-1-call branch exactly. The comment block is updated to match the new constants, the test still pins the same behaviour (RFC 6762 §14 protected aggregation: no send before 1020ms, exactly one send after the full window), and no production code is touched. Merge-ready. Checklist
SummaryTargeted, well-reasoned fix for a Windows-CI flake. Math is internally consistent: the new pre-assertion gap below the 1020ms minimum widens from ~100ms to ~520ms (well clear of Windows' ~15.6ms default timer resolution), and the second sleep is rebalanced so the total elapsed time remains 1340ms — preserving the headroom of the assert-1-call branch exactly. The comment block is updated to match the new constants, the test still pins the same behaviour (RFC 6762 §14 protected aggregation: no send before 1020ms, exactly one send after the full window), and no production code is touched. Merge-ready. Automated review by Kōan417f97e |
Summary
test_response_aggregation_timings_multipleslept 900ms before asserting that no protected aggregation send had fired; the minimum protected send_after is 1020ms (1000ms RFC 6762 §14 protection plus a 20ms random floor), so the margin was only 100ms. On Windows runners with coarse timer resolution the sleep can overshoot that gap, the timer fires, and the assertion sees 1 call instead of 0.Details
Test plan
SKIP_CYTHON=1 poetry run pytest tests/test_handlers.py::test_response_aggregation_timings_multiplepasses locally