Skip to content

test(e2e): raise the large-body H2 drain budget from 8s to a measured 30s - #1402

Merged
FlorentinDUBOIS merged 1 commit into
mainfrom
fix/h2-large-drain-budget
Sep 21, 2026
Merged

FlorentinDUBOIS merged 1 commit into
mainfrom
fix/h2-large-drain-budget

Conversation

@FlorentinDUBOIS

Copy link
Copy Markdown
Collaborator

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:

body_bytes=3440640/7763292 elapsed=8.036659064s      (44.32% transferred)

A lost wake-up was excluded rather than assumed, on three grounds:

  • every write-queueing site on this path in lib/src/protocol/mux/h1.rs pairs arm_writable() / signal_pending_write() with an explicit edge-triggered-epoll comment, and writable() asserts the invariant;
  • h2.rs has a window-stall reaper with its own passing e2e test;
  • decisively — in the same CI job and the same ~30 s window, the sibling test_h2_large_gzipped_chunked_drains_fully (same payload, same drain_h2_stream_streaming helper, 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

measurement value
idle, 20 cores, crypto-ring and fips 272–287 ms (11 samples)
full local suite in parallel, 20 cores 697 ms – 1.121 s
h2_ subset, taskset -c 0-3 (matches ubuntu-latest's 4 vCPU) 749–793 ms
CI sibling test, realized cycle 6.073 s, 6.606 s
CI failure, linear extrapolation ~18.1 s (8.037 / 0.4432)

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_BUDGET was. The constant says so, and says that the printed elapsed= is the datum required to tighten it, so it cannot be quietly raised again without one.

Both tests now print budget= beside elapsed=, 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:

cargo +1.93.1 build -p sozu-e2e --lib                              exit 0
cargo +1.93.1 clippy -p sozu-e2e --all-targets -- -D warnings      exit 0
cargo +nightly fmt --all -- --check                                exit 0
python3 .github/scripts/check_doc_citations.py                     exit 0
python3 .github/scripts/check_doc_citations.py --base origin/main   exit 0

Both tests pass locally at 282–290 ms against the 30 s budget.

Because main advanced to 42df3fd0 (#1401) after this branch was cut, and #1401 also touched doc/testing.md and doc/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:

OK: none of the 248 cited lines compared against f798fdf5e73a changed their text.

The two doc/testing.md citations 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:

old 3559 @origin/main :     let _server_settings = h2_handshake_chromium_146(&mut tls);
new 3604 @merge       :     let _server_settings = h2_handshake_chromium_146(&mut tls);
old 3663 @origin/main :     let _server_settings = h2_handshake_chromium_146(&mut tls);
new 3708 @merge       :     let _server_settings = h2_handshake_chromium_146(&mut tls);

Scope

doc/h2_mux_internals.md restated the old "within 8 s" figure and is corrected in the same changeset. e2e/COVERAGE.md and every LIFECYCLE.md were grepped for both test names and an 8-second claim; none mention it. The three other Duration::from_secs(8) occurrences in the file belong to different tests and are untouched. No Cargo.toml touched.

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.

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
FlorentinDUBOIS merged commit 7be6595 into main Sep 21, 2026
24 checks passed
@FlorentinDUBOIS
FlorentinDUBOIS deleted the fix/h2-large-drain-budget branch September 21, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant