Skip to content

e2e: five tests failed on CI between 2026-09-18 and 2026-09-21; their captured diagnostics name four distinct causes, not one flake #1393

Closed

Description

@FlorentinDUBOIS

Between 2026-09-18 and 2026-09-21, five distinct sozu-e2e tests failed on CI. Every one of them
produced the same top-level message:

assertion `left == right` failed
  left: Fail
 right: Success

That message is identical in all five cases and carries no information: State::Fail is the
collapse of every conjunct the test evaluates. The useful line is in the failing test's own
captured stdout, a few lines above the panic in a 1.5–2.8 MB job log.

Those lines are collected here. They do not describe one flaky-CI phenomenon — they describe
four different causes, one of which is a test defect with a deterministic trigger and one of
which is very likely already fixed.

Retrieval note: gh api --allow-escape-sequences /repos/sozu-proxy/sozu/actions/jobs/<id>/logs.
Without --allow-escape-sequences the command exits 0 and returns 0 bytes, because CARGO_TERM_COLOR: always puts ANSI sequences in the log.

What failed

test n job(s) check / head
tcp_sni_tests::test_tcp_sni_large_payload_coalesced_with_hello_delivered_intact 4 106184455406, 106079594206, 105918489240, 105801528026 msrv-full e4aac48e, crypto-aws-lc-rs ea96f923, crypto-ring 8be51676, msrv-full 47d1a04e
hsts_tests::test_hsts_on_https_unreachable_503 1 106159647573 fips 683c08cb
protocol_pair_matrix::basic_auth::test_h2_h1 1 105936834981 msrv-bare 0cb1e2a7
h1_security_tests::test_h1_custom_answer_with_out_of_range_status_does_not_kill_the_worker 1 105898321274 fips 5cb5395e
h2_correctness_tests::test_h2_large_chunked_7mb_drains_fully 1 106203022602 fips 32b8e486

Each failure is 1 failed of 435–436, on a runner concurrently executing the rest of the suite
(finished in 1393–1445 s).

Cause A — a routed tcp_preread connection forwarded zero bytes (4 occurrences)

Identical in all four jobs, modulo the payload length:

coalesced large payload delivered intact: write_completed=true backend_contacted=false
backend received 0 of 1048832 expected bytes, byte_identical=false,
tcp.sni_preread.rejected.too_large=None, tcp.sni_preread.routed=Some(1), routed_ok=true

sozu routed the connection (tcp.sni_preread.routed=1, rejected.too_large=0), the client
wrote the whole 1 MiB without error (write_completed=true), and the backend received zero
bytes
. Not truncation, not corruption — nothing at all.

This is the code path of #1373, and test_tcp_sni_large_payload_coalesced_with_hello_delivered_intact
(e2e/src/tests/tcp_sni_tests.rs:1842) constructs exactly its precondition: it writes the
ClientHello and a 1 MiB payload back to back, filling the frontend buffer while the backend
connection is still being established.

All four failures are on trees that do not contain the fix (5b83908a, #1387, merged
2026-09-21); there has been no occurrence since, and the test passed in the one post-fix job that
failed for another reason (32b8e486, which does contain it).

This is a hypothesis, not a proof: the job log carries no worker output showing a session hitting
the loop guard. Disposition: watch. A recurrence on a tree containing 5b83908a means a second
bug and this section should be split out.

Cause B — client error (SendRequest): the connection closed before any response (2 occurrences, 2 tests)

hsts_tests::test_hsts_on_https_unreachable_503:

Could not get response: client error (SendRequest)
HTTPS unreachable-backend request failed entirely

protocol_pair_matrix::basic_auth::test_h2_h1:

matrix request failed: client error (SendRequest)
basic-auth arm1: expected 401 (no Authorization), got None

Same hyper error, two different tests, two different days, two different crypto feature sets.
Neither is a timeout: both helpers print a distinct message on timeout
(resolve_request_with_headers timed out after 10s / matrix request timed out, both at a 10 s
budget — e2e/src/mock/https_client.rs:159, e2e/src/tests/protocol_pair_matrix.rs:369) and
neither appears. The TLS connection to sozu was closed before a response was delivered.

In the HSTS case the assertion never got as far as evaluating the status or the
Strict-Transport-Security header, so the test name is misleading about what broke.

This is the one cause with no candidate explanation. Two samples is thin, but they agree.

Cause C — a test defect: !contains("000") matches the ULID Sozu-Id (1 occurrence)

H1-BAD-ANSWER: listener_added=true still_serving=true builtin_answer_selected=false stopped=true

builtin_answer_selected is (e2e/src/tests/h1_security_tests.rs:2117):

let builtin_answer_selected =
    stray_answer.starts_with("HTTP/1.1 404") && !stray_answer.contains("000");

The intent is "the operator's out-of-range 000 status was not selected". The answer that failed
it, printed verbatim two lines earlier in the same job, is a perfectly correct builtin 404:

HTTP/1.1 404 Not Found ... Sozu-Id: 01M2WV005MHC6FDKVS19000JFY ...

01M2WV005MHC6FDKVS19000JFY contains 000. The guard scans the whole response — status line,
Sozu-Id header, and the request_id repeated in the HTML body — for a three-character substring
that a Crockford-base32 ULID produces on its own often enough to be seen once in four days. The
preceding request in the same run got 01M2WV005JRA3CXKWPPESY3TCR and passed.

This one is not a flake in sozu and is fully diagnosed. Fix: assert on the status line only, e.g.
!stray_answer.starts_with("HTTP/1.1 000"), and keep the starts_with("HTTP/1.1 404") conjunct.
It wants a red-then-green regression test pinned on a Sozu-Id containing 000.

Cause D — an 8 s wall-clock budget missed at 44 % drained (1 occurrence)

h2 7MB smoke: body_bytes=3440640/7763292 end_stream=false rst=false elapsed=8.036659064s backend_responses=1
  sozu still alive: true

No error and no reset: a deadline. e2e/src/tests/h2_correctness_tests.rs:3678 gives
drain_h2_stream_streaming 8 s and line 3703 asserts outcome.elapsed < Duration::from_secs(8);
the runner delivered 3.4 MB of 7.8 MB inside it. Same shape as #1376 — a wall-clock budget with no
slack, measured on a runner also executing 435 other tests.

This is the only one of the five observed on a tree that does contain 5b83908a, so it is
independent of cause A.

The harness does not retry

repeat_until_error_or(3, …) (e2e/src/tests/mod.rs:240) runs the body up to three times and
returns on the first State::Fail. It repeats on success; it is a stability check, not a
retry. "The retry harness would have absorbed a transient" is therefore never available as an
explanation, and a single State::Fail is the entire evidence for that job.

Four of the five failed on iteration 1. test_hsts_on_https_unreachable_503 failed on iteration 2,
i.e. it passed once in the same job first.

Precedent

The same shape on 2026-09-15 —
job 104473612456,
h2_security_sni::e2e_h2_sni_authority_mismatch_allowed_when_strict_binding_disabled, a bare
left: Fail / right: Success — was #1353, and it was a real bug, not runner load. A State::Fail
is not evidence of flakiness; it is evidence of nothing until its conjuncts are read.

Suggested handling

  1. Cause C is diagnosed and fixable now; it is a test defect and nothing else.
  2. Cause A needs no new work unless it recurs on a tree containing 5b83908a (fix(tcp): stop re-arming frontend-readable on a routed SNI preread #1387).
  3. Cause D is a budget question, the same one e2e: test_issue_810_timeout asserts a zero-slack 100ms wall-clock budget and flakes on CI runners #1376 answered for test_issue_810_timeout.
  4. Cause B is the only open one. Two client error (SendRequest) samples, no timeout, two
    unrelated tests.
  5. Independently of all four: a test that returns State::Fail without printing its conjuncts
    cannot be diagnosed from a CI log at all. Every test quoted here was diagnosable because it
    printed them; that convention is worth keeping mandatory for new e2e guards.

Activity

  1. FlorentinDUBOIS commented on Sep 21, 2026

    @FlorentinDUBOIS
    CollaboratorAuthor

    Status 2026-09-21: causes B and C are fixed on main; A is watch-only; D is open

    cause what it was state
    A — a routed tcp_preread connection forwarded zero bytes (4 occurrences) the tcp_preread path of #1373 watch-only. All four failures are on trees that do not contain 5b83908a (#1387), and there has been no occurrence since. Nothing to fix unless it recurs on a tree containing that commit — which would mean a second, different bug.
    B — client error (SendRequest), the connection closed before any response (2 occurrences, 2 tests) hyper's outer message only; the std::error::Error source chain was discarded fixed by #1395. https_client::format_error_chain now walks .source() and every bare {error} print goes through it. The next occurrence names the actual transport failure instead of SendRequest. The root cause itself is still unknown — this makes the next sample diagnosable, it does not explain the two we have.
    C — !contains("000") matched the ULID Sozu-Id a test defect, deterministic given the request id fixed by #1394. Both conjuncts now read the status line only. Pinned by a regression test carrying the exact ULID that failed in CI, so it does not depend on drawing an unlucky id.
    D — the 7 MB drain budget missed at 44 % drained an 8 s wall-clock bound with no slack open. Deriving it needs measured local runs in the style of ISSUE_810_SHUTDOWN_BUDGET (#1390). Raising the bound to reach green is not on the table, and a derivation nobody measured would be worse than the unchanged test.

    Also landed: test_tls_connection_close_large_response now names its failing conjunct and
    distinguishes truncation from corruption (#1395). It has never failed, but it carried the same bare
    assert_eq!(…, State::Success) shape that made every failure in this issue cost a log-archaeology
    session.

    This issue stays open for A and D.

  2. FlorentinDUBOIS commented on Sep 21, 2026

    @FlorentinDUBOIS
    CollaboratorAuthor

    Cause D is resolved by #1402 (4278f898, merged into main at 7be65954). All four causes behind this issue are now closed.

    cause what it was resolution
    A tcp_sni_tests::test_tcp_sni_large_payload_coalesced_with_hello_delivered_intact ×4 watch-only — all four occurrences (47d1a04e, 8be51676, ea96f923, e4aac48e) predate the #1373 spin fix 5b83908a, and none since
    B client error (SendRequest) ×2 #1395 — error chains now render .source(), so the next occurrence names its own cause
    C h1_security_tests !contains("000") matching a ULID #1394 — the guard reads the status line, not the whole answer
    D test_h2_large_chunked_7mb_drains_fully, 44% at 8.036 s #1402 — an unmeasured budget, now measured

    On cause D specifically

    It was the only one of the five failures on a tree that already contained 5b83908a, so "the spin fix covers it" was never available.

    It is not a stall. That was excluded rather than assumed: every write-queueing site on this path in h1.rs pairs arm_writable() / signal_pending_write() with an explicit edge-triggered-epoll comment, h2.rs has a window-stall reaper with its own passing test, and — decisively — the sibling test_h2_large_gzipped_chunked_drains_fully ran in the same CI job and the same contention window, passing all three iterations with 6.606 s and 6.073 s cycles against its own ~285 ms idle baseline. A lost wake-up does not recover on its own three times.

    The 8 s bound was never validated against CI contention. The commit that introduced these tests (23f5f4f7, 2026-04-24) recorded only "typical local run: ~285 ms per iteration" — 8 s was 28× an idle-only figure. It was a round number, not a budget.

    LARGE_BODY_DRAIN_BUDGET is 30 s, derived from the idle baseline, the loaded-local ceiling on 4 pinned cores matching ubuntu-latest's actual vCPU count, the CI sibling's realized cycle and the failure's own extrapolation (~18.1 s). It stays inside DEFAULT_FRONT_TIMEOUT (60 s) so the test still fails rather than tripping the proxy's own timeout first.

    Two things deliberately recorded at the constant rather than here, so they cannot drift from the code they bound: the full measurement table, and an explicit admission that 30 s is extrapolated from one CI snapshot plus a same-run sibling — not measured end to end the way ISSUE_810_SHUTDOWN_BUDGET was. The best local reproduction reaches ~1.1 s, an order of magnitude short of what CI needed. The constant names the printed elapsed= as 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 failure, so any recurrence carries the comparison in the log.

    If cause A recurs

    Act only if it appears on a tree containing 5b83908a. Its diagnostic was write_completed=true backend_contacted=false … received 0 of 1048832 … routed=Some(1) routed_ok=true — routed successfully, backend never contacted, which is the spin signature the #1373 fix addressed.

    Closing. Reopen if any cause returns.

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