Skip to content

e2e: try_msg_close has no failure path, yet runs 100 consecutive iterations that cannot fail #1426

Closed

Description

@FlorentinDUBOIS

try_msg_close (e2e/src/tests/tests.rs) contains no failure path. Its only State:: expression
is the State::Success it returns at the end — grep -c "State::Fail" over its body returns 0.

It is invoked as:

repeat_until_error_or(100, "HTTP error on close", try_msg_close),

So the suite runs a hundred iterations of a check that cannot fail. It costs runtime and provides no
assurance in either direction: it can never go red, so it can never catch a regression, and its green
is not evidence of anything.

Why the 100 makes it worse rather than better

repeat_until_error_or(n, …) is a stability check, not a retry — it requires n consecutive
successes and fails on the first bad trial. A high n is therefore how a test says "this must work
every single time under load".

For a body with no failure path, n is pure cost. A hundred iterations of an unfalsifiable assertion
is the largest single block of runtime in the suite spent on nothing.

Context: the twelve n = 100 sites

Counted across e2e/src/tests/ with a multi-line-aware scan, since these calls wrap their arguments
onto following lines and a single-line grep misses nearly all of them — worth noting because it is how
this went uncounted:

  • 4 are issue-806/810 timing-budget regressions, whose doc comments justify the repetition.
    Legitimate.
  • 7 are TLS certificate and cipher-suite handshake tests — "Sōzu should decrypt an HTTPS request",
    "HTTPS with RSA-2048 certificate", "TLS 1.3 only with ECDSA", and so on. Each asserts that a given
    cert-and-cipher combination completes one handshake and one request. That is a property a single
    clean run proves; repeating it a hundred times multiplies exposure to any per-trial flake by a
    hundred for no additional assurance. Worth a maintainer decision rather than a unilateral change.
  • 1 is this one, which cannot fail at all.

Suggested resolution

Two separate questions, and they should not be answered together.

For try_msg_close: either give it the assertions its name implies — it is meant to check there is
no HTTP error on close, so it should be able to observe one — or delete it. A test that cannot fail is
worse than no test, because it occupies the slot where a real one would go and its green reads as
coverage.

For the seven TLS handshake tests: a decision about what n means for a deterministic property.
Reducing it is not "weakening a check" if one clean handshake already proves the property, but that is
the maintainer's call, not something to change on the way past.

How it was found

While auditing every caller of repeat_until_error_or as part of clarifying its semantics (#1410).
The audit was scoped to whether each call site wants consecutive repetition, and this one turned out
not to want anything, because it asserts nothing.

What I verified, and what I did not

Verified by reading try_msg_close's body in full — one State::Success, no State::Fail, no early
return — and its single call site with n = 100; and by counting all repeat_until_error_or sites
with a multi-line-aware scan: 4 at n=1, 51 at 2, 118 at 3, 144 at 5, 74 at 10, 12 at 100.

Not verified: I did not trace what try_msg_close was originally intended to assert, nor check
git history for whether it once had a failure path that was removed.

Activity

  1. added 2 commits that reference this issue on Sep 22, 2026
    9505520
    fa38080
  2. added a commit that references this issue on Sep 22, 2026
    df85b4c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions