Repository navigation
test(e2e): raise the large-body H2 drain budget from 8s to a measured 30s - #1402
Merged
Merged
Conversation
try_h2_large_gzipped_chunked_drains_fully and try_h2_large_chunked_7mb_drains_fully (e2e/src/tests/h2_correctness_tests.rs) bounded their drain_h2_stream_streaming call and elapsed-time assertion with an unvalidated Duration::from_secs(8): the commit that introduced these tests recorded only a local idle baseline, never a figure measured against CI contention. It failed on a tree that already contains the #1373 spin fix, at body_bytes=3440640/7763292 elapsed=8.036659064s (44.32% transferred). A stall was excluded rather than assumed: in the same CI job and the same contention episode, the same-job sibling test recovered and passed three times, with handshake-to-handshake cycles of 6.6s against its own ~285ms idle baseline. Both call sites now use LARGE_BODY_DRAIN_BUDGET = 30s, which carries the full measurement record in its doc comment and stays well inside DEFAULT_FRONT_TIMEOUT (60s) so the test still fails outright rather than tripping the proxy's own timeout first. CHANGELOG.md records the bound change and doc/h2_mux_internals.md's large-asset coverage section, which restated the old 8s figure, is corrected in the same changeset; doc/testing.md's two h2_correctness_tests.rs line citations are re-anchored past the doc comment's insertion. Closes cause D of #1393. Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS
requested review from
Wonshtrum and
llenotre
as code owners
September 21, 2026 14:22
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.
Closes cause D of #1393 — the last of the four distinct causes behind that issue's five CI failures.
This raises a bound, so here is why it is not weakening a check
The rule in this repository is that you do not raise a bound to reach green. The distinction that makes this legitimate is narrow and worth stating plainly: the new number is derived from measurement and the old one never was.
The commit that introduced these tests (
23f5f4f7, 2026-04-24) recorded only "typical local run: ~285 ms per iteration". The 8 s bound was 28× an idle-only figure, with no margin anyone had ever measured against a loaded runner. It was not a budget; it was a round number.The failure, and why it is not a stall
On 2026-09-21, on a tree that already contained the #1373 spin fix
5b83908a— so that fix does not cover it:A lost wake-up was excluded rather than assumed, on three grounds:
lib/src/protocol/mux/h1.rspairsarm_writable()/signal_pending_write()with an explicit edge-triggered-epoll comment, andwritable()asserts the invariant;h2.rshas a window-stall reaper with its own passing e2e test;test_h2_large_gzipped_chunked_drains_fully(same payload, samedrain_h2_stream_streaminghelper, same 8 s bound) passed all three iterations, with handshake-to-handshake cycles of 6.606 s and 6.073 s against its own ~285 ms idle baseline.A lost wake-up does not recover on its own three times under the same contention episode. Severe scheduling delay does.
Where 30 s comes from
h2_subset,taskset -c 0-3(matchesubuntu-latest's 4 vCPU)30 s is ~1.7× that extrapolation and ~4.5× the sibling's realized cycle, while staying well inside
DEFAULT_FRONT_TIMEOUT(60 s) so the test still fails outright rather than tripping the proxy's own timeout first.The full record lives at the constant, not in this description and not in the CHANGELOG, so it cannot drift out of sync with the code it bounds — the failure mode #1389 and #1399 both dealt with.
What is deliberately admitted in the constant
The best local reproduction reaches ~1.1 s, an order of magnitude short of what CI needed that day. So this bound is extrapolated from one CI snapshot plus a same-run corroborating sibling — not measured end to end the way
ISSUE_810_SHUTDOWN_BUDGETwas. The constant says so, and says that the printedelapsed=is the datum required to tighten it, so it cannot be quietly raised again without one.Both tests now print
budget=besideelapsed=, on success and on failure, so any future occurrence carries the comparison in the log rather than needing it reconstructed.Verification
Re-run independently, not taken from the implementation report:
Both tests pass locally at 282–290 ms against the 30 s budget.
Because
mainadvanced to42df3fd0(#1401) after this branch was cut, and #1401 also toucheddoc/testing.mdanddoc/h2_mux_internals.md, I ran the citation gate against the merge result rather than the branch — that is what CI checks, and a branch that passes alone can still break the merge:The two
doc/testing.mdcitations that the constant's insertion shifted (3559→3604,3663→3708) were also verified by hand on the merge result, since the drift rule skips any citation whose(path, spans)pair changed and therefore cannot catch a bad re-anchor:Scope
doc/h2_mux_internals.mdrestated the old "within 8 s" figure and is corrected in the same changeset.e2e/COVERAGE.mdand everyLIFECYCLE.mdwere grepped for both test names and an 8-second claim; none mention it. The three otherDuration::from_secs(8)occurrences in the file belong to different tests and are untouched. NoCargo.tomltouched.With this, all four causes behind #1393 are resolved: cause A is watch-only (every occurrence predates
5b83908a), cause B landed in #1395, cause C in #1394, and cause D here.