PYTHON-5974 Loosen baseBackoffMS prose test timing - #2967
Open
NoahStapp wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR loosens the lower-bound timing assertions in the Client Backpressure spec test that measures baseBackoffMS-related retry delays, reducing test flakiness caused by timing variance across environments.
Changes:
- Reduced the minimum expected duration for the default exponential backoff run (0.6s → 0.55s).
- Reduced the minimum expected duration for the
baseBackoffMS=50run (0.3s → 0.25s). - Added an explanatory comment about timing slack (but currently phrased inconsistently with the assertions and the sync/async variants).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/test_client_backpressure.py | Loosens lower-bound timing assertions for the synchronous prose test. |
| test/asynchronous/test_client_backpressure.py | Loosens lower-bound timing assertions for the asynchronous prose test. |
Contributor
Author
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
blink1073
reviewed
Jul 29, 2026
| # and the baseBackoffMS=50 backoffs are 0.1 + 0.2 = 0.3s. | ||
| self.assertGreaterEqual(exponential_backoff_time, 0.6) | ||
| self.assertGreaterEqual(with_base_backoff_ms_time, 0.3) | ||
| # Allow for slight timing slack due to asyncio timing resolution on Windows <= Python 3.12 |
Member
There was a problem hiding this comment.
Can we only set the different timings in this scenario, to align with the spec otherwise?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PYTHON-5974
Changes in this PR
Loosens timing requirements for the affected test to allow for the slight variation seen between platforms. Asyncio running on Windows + Python <= 3.12 has a rougher granularity for loop timers that can cause the test to fail.
Test Plan
Test change.
Checklist
Checklist for Author
[ ] Did you update the changelog (if necessary)?[ ] Is any followup work tracked in a JIRA ticket? If so, add link(s).Checklist for Reviewer