Repository navigation
test(backends): give the transfer-phase assertion room to breathe - #290
Merged
Merged
Conversation
test_breakdown_transfer_covers_body_read asserted transfer >= 0.15 against a 0.2s gap between headers and body -- a 25% margin. The client does not parse the response headers the instant the server sends them, and on a loaded macos-latest 3.10 runner that slack came out of the measured gap: 0.1437s, and the build went red. The gap is 0.4s now, and the assertions lead with the relational one: transfer > ttfb. Pre-fix transfer was exactly 0.0 while ttfb held the headers time, so that comparison catches the bug on any runner, at any speed. The absolute bound is half the delay rather than three quarters of it. Signed-off-by: Yurii Riabikov <22548029+kurok@users.noreply.github.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Third CI flake this session, and this one is mine — I introduced it in #277 (issue #228). It turned PR #289 red on macos-latest 3.10.
Root cause
test_breakdown_transfer_covers_body_readassertedtransfer >= 0.15against a 0.2 s gap between headers and body. That is a 25% margin, and the client does not parse the response headers the instant the server sends them — on a loaded runner that slack comes out of the measured gap:The measurement was right; the bound was too tight for the machine.
The fix
The gap is 0.4 s, and the assertions now lead with the relational one:
Pre-fix
transferwas exactly0.0whilettfbheld the headers time, sotransfer > ttfbcatches the original bug on any runner at any speed — it does not depend on a number I picked. The absolute bound is now half the delay rather than three quarters of it.Verified the test still fails against the unpatched
backends.py(withfinalize_breakdownremoved fromsend): both tests fail.Ran three times locally, stable.
1913 passed.