Repository navigation
test(e2e): read the status line in the h1 unselectable-000 guard - #1394
Merged
Merged
Conversation
`test_h1_custom_answer_with_out_of_range_status_does_not_kill_the_worker`
asserted that an unrouted request drew the builtin 404 and not the
operator's out-of-range `000` answer with `!stray_answer.contains("000")`,
a substring scan of the WHOLE response. The builtin 404 repeats a Crockford
base32 ULID in its `Sozu-Id` header and again in the `request_id` field of
its HTML body, and roughly one ULID in twenty carries the substring `000`,
so a perfectly correct answer reddened the guard: CI job 105898321274
(check `fips`, head `5cb5395e`, 2026-09-19) failed on
`HTTP/1.1 404 Not Found ... Sozu-Id: 01M2WV005MHC6FDKVS19000JFY`, while the
request immediately before it drew `01M2WV005JRA3CXKWPPESY3TCR` and passed.
That is cause C of #1393, a defect in the assertion and not
in sozu.
Extract the guard as `builtin_404_answer_selected` and scope both conjuncts
to the status line. The positive `HTTP/1.1 404` conjunct is unchanged; the
negative one now states what it always meant -- that the status line is not
`HTTP/1.1 000` -- instead of scanning headers and body for three digits.
`the_unselectable_000_guard_reads_the_status_line_not_the_whole_answer`
exercises the predicate directly against the captured failing answer, so
the regression no longer waits on an unlucky draw, and against the
operator's own `000` answer, so the negative conjunct cannot be repaired by
deleting it.
Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS
requested review from
Wonshtrum and
llenotre
as code owners
September 21, 2026 07:16
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 C of #1393.
The defect
test_h1_custom_answer_with_out_of_range_status_does_not_kill_the_workerasserted that an unroutedrequest drew the builtin 404 and not the operator's out-of-range
000answer, with!stray_answer.contains("000")— a substring scan of the whole response.raw_read_allreturns everything, and the builtin 404 repeats a Crockford base32 ULID twice: oncein the
Sozu-Idresponse header, once in therequest_idfield of the HTML body. Roughly one ULIDin twenty carries the substring
000, so a perfectly correct answer reddened the guard.It fired on 2026-09-19, job 105898321274
(check
fips, head5cb5395e), on:The request immediately before it drew
01M2WV005JRA3CXKWPPESY3TCRand passed. A defect in theassertion, not in sōzu.
The change
The guard becomes a named predicate, with both conjuncts scoped to the status line:
Neither conjunct is deleted. The positive one is byte-identical. The negative one now states what
the surrounding comment already claimed it meant.
Red-then-green
A regression test that waited for an unlucky ULID would detect nothing, so it is pinned to the exact
answer that failed in CI —
Sozu-Idand the bodyrequest_idboth carrying01M2WV005MHC6FDKVS19000JFY. Against the historical predicate body:and against the fixed one,
test result: ok. 1 passed; 0 failed. Three further assertions pin thepassing neighbour draw, the operator's own
HTTP/1.1 000answer (which must still be rejected —this is what stops the mutation being "repaired" by deleting the negative conjunct), and a
CRLF-less truncated line.
The owning e2e test now reports
builtin_answer_selected=trueon all three harness iterations.Reference sweep
contains("<digits>")ine2e/splits into two shapes. The absence-asserting form(
… && !x.contains("NNN")), which a ULID collision turns into a spurious red, has exactly one hitrepo-wide — this one. The ~75 presence-asserting hits across five files are the opposite failure
mode: a ULID carrying the digits can only make a wrong status read as right, never produce a flaky
red. They are left as found and noted in #1393 as a separate latent class.
Scope
One file, test-only. No behaviour, route, metric, configuration key or CLI flag moves, so neither
doc/norCHANGELOG.mdhas anything to restate.