Repository navigation
Description
repeat_until_error_or(n, …) (e2e/src/tests/mod.rs) reads like a retry helper. It is not one. It
loops while iterations succeed and returns Fail on the first failing iteration, so
repeat_until_error_or(5, …) requires five consecutive clean runs and fails the whole test on any
single bad trial.
Every test built on it is therefore about five times more exposed to a rare per-trial race than its
call site suggests, and a failure report of the form "Test not successful after: 3 iterations" means
the third trial failed, not three attempts were made and all failed.
How this surfaced
tests::tls_tests::test_tls_connection_close_large_response failed the msrv-bare cell of a PR whose
diff cannot reach it:
TLS-CONN-CLOSE-LARGE: FAIL - backend sent 0 responses, expected 1
Test not successful after: 3 iterations
thread '...' panicked at e2e/src/tests/tls_tests.rs:1242:5:
assertion `left == right` failed
left: Fail
right: Success
test result: FAILED. 437 passed; 1 failed; ... finished in 1435.28s
The first two iterations passed silently; the third died with the backend never contacted.
Investigated and ruled not a regression: that test forces ALPN http/1.1, so it never reaches the H2
code the PR touched; and the test passed 7/7 locally — one full suite plus three isolated runs on the
PR branch and three on its base.
Why this is worth its own issue rather than folding into #1393
#1393 catalogued five CI failures across tcp_sni_tests, hsts_tests, protocol_pair_matrix and
h1_security_tests, all with the same left: Fail / right: Success shape and the same
"backend received 0 bytes" symptom late in ~1400s runs. It was closed once each of its four causes was
resolved, with "reopen if any cause returns".
This is a different test, on a tree that contains every fix from that issue, and — more usefully —
it points at a structural property of the harness that #1393 did not identify: the amplification
factor built into repeat_until_error_or. That is a property of the helper, not of any one test, and
it is worth fixing or documenting once rather than rediscovering per test.
Two directions, not a proposal
Document the semantics. The name promises retry and delivers stability-checking. At minimum the
doc comment should say so, and the failure message should read "iteration 3 of 5 failed" rather than
"not successful after 3 iterations", which currently reads as an exhausted retry budget.
Decide whether five consecutive trials is the intended contract for each caller. For a test whose
point is "this must work every time", it is. For one where a single clean delivery proves the property
under test, it multiplies exposure for no additional assurance. The callers should be audited against
that question rather than all inheriting the same 5.
Fixing the underlying race — whatever makes a backend occasionally receive zero bytes on a fresh
spin-up — is a separate and larger question, and is the one #1393's Cause A left as watch-only.
Worth recording: the diagnostic added in #1395 did its job
That changeset hardened this exact test to name its failing conjunct and distinguish truncation from
corruption, specifically because it carried the bare assert_eq!(…, State::Success) shape that made
every #1393 failure cost a log-archaeology session — and noted the test had never failed.
It has now failed for the first time, and instead of a bare Fail the log says
backend sent 0 responses, expected 1. That single line is what made this diagnosis take minutes
instead of a session. Hardening a test that has never failed is hard to justify at the time and this
is what it buys.
Activity
test(e2e): clarify repeat_until_error_or is a stability check, not a …
FlorentinDUBOIS commentedon Sep 22, 2026
Resolved by #1431, squash-merged into
main. The helper keeps its name; its doc comment, failure message and the prose around it now state that it is a stability check requiring n consecutive successes, not a retry budget. Two further defects found while auditing the call sites are tracked separately as #1426 and #1427.