rest: witness cacheControlWriter rollback reopen and stamped guard (#178)#188
Merged
Conversation
) Two test-only pins on the unwitnessed lines of FlushError's rollback block (rest/cachecontrol.go unchanged), killing the two mutants the wave-3 kill-matrix found surviving: - Reopen pin: a refused flush (ErrNotSupported, nothing sent) followed by a shrugging 200 Write must re-stamp Cache-Control — committed=false reopens the commit latch so the freshness signal reaches the wire. - Guard pin: a refused flush AFTER a real WriteHeader(200) must not delete the stamp the commit already took — the stamped && guard keeps the rollback scoped to what THIS flush latched. Both ride noFlushWriter from the #174 error-path fake family and assert the refusal class via errors.Is(err, http.ErrNotSupported).
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 #178.
What
Two test-only pins (+44 lines,
rest/cachecontrol_internal_test.go) witnessing the two unwitnessed lines ofcacheControlWriter.FlushError's rollback block — both mutants previously survived the full module suite (confirmed red-bar premise on this base before pinning):errors.Is→http.ErrNotSupported), handler shrugs and writes its 200 body anyway: the response must carry theCache-Controlstamp, because the rollback reopened the commit latch. Asserts the commit-time snapshot (rr.Result().Header). Kills thew.committed = falsedeletion mutant.WriteHeader(200)then refused flush: the refusal must not delete the stamp the commit already took. Asserts the live header map (required, not stylistic — aResult()assertion would let the mutant survive). Kills thestamped &&deletion mutant.Reuses
noFlushWriterfrom #174's fake family — no sibling helper.Validation
-race ./rest/— all green.🤖 Generated with Claude Code