Skip to content

🧪 test(driver): close the jobs and rate-limit survivors - #2254

Merged
gaborbernat merged 2 commits into
mainfrom
test/driver-mutants-1893-b
Sep 9, 2026
Merged

🧪 test(driver): close the jobs and rate-limit survivors#2254
gaborbernat merged 2 commits into
mainfrom
test/driver-mutants-1893-b

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

A fresh cargo mutants -p peryx-driver pass over jobs/mod.rs and rate_limit.rs, 226 mutants, found the crate's own suite blind to three of them and unable to decide five more. This closes all eight for #1893, and both files now measure zero survivors. 🎯

Seven jobs built the same JobReport literal by hand, and the copies in the cancelled arms of the history cleanup, the ledger reap and the aborted search rebuild could drop either counter unnoticed. A cancelled sweep only reports work when cancellation lands between two store batches, which no caller can place, so those literals carried a decision nothing could observe. Two constructors, JobReport::changed for a run whose changed count equals its processed count and JobReport::examined for a sweep that changed nothing, replace the copies; the decision now lives in one place the succeeded arms already prove, and an aborted rebuild reads as the examined case it is.

The two drain loops gained the states that decide their exit. A history backlog wider than the store's 128-run batch shows the cleanup keeps pruning past the first batch, and a reap with one row per ledger per pass shows the loop runs until every ledger is empty rather than until the first one is; under the mutation the expiry ledger empties first and the loop leaves the outcomes for a later tick. ♻️

RateLimiter::trusts_any_proxy had no caller in the crate; peryx-http asks it before reading forwarded headers. A limiter answering a constant either way passed the suite, so one case now pins both answers. The two ActorKey::kind survivors this crate was tracking as blocked are already dead: #2213 ported the binary-lifetime capture subscriber and pinned the client kind a refusal names, and the run here catches both.

Refs #1893

Seven jobs built the same report literal by hand, and a mutation run showed
that the copies in the cancelled arms could drop either counter unnoticed. A
cancelled cleanup or reap only reports work when cancellation lands between two
batches, which no test can place, so the literals carried a decision nothing
could observe.

One constructor for a report whose changed count equals its processed count,
and one for a sweep that examined items without changing any, replaces the
copies. The decision now lives in one place that the succeeded arms already
prove, and an aborted search rebuild reads as the examined case it is.

The two drain loops also gained the states that decide their exit. A history
backlog wider than one store batch shows the cleanup keeps pruning past the
first batch, and a reap with one row per ledger per pass shows the loop runs
until every ledger is empty rather than until the first one is.

Refs #1893
The response security layer asks the limiter whether any proxy is trusted
before it reads forwarded headers, and no test in this crate ever called the
question. A limiter answering a constant either way passed the suite: one that
always said yes would parse headers it then ignores, and one that always said
no over a configured proxy would bucket every proxied client by the proxy's
own address.

Both answers are pinned from one test, since either constant satisfies one of
them alone.

Refs #1893
@codspeed-hq

codspeed-hq Bot commented Sep 9, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 29 untouched benchmarks
⏩ 133 skipped benchmarks1


Comparing test/driver-mutants-1893-b (d77311d) with main (a7dab14)

Open in CodSpeed

Footnotes

  1. 133 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@gaborbernat
gaborbernat merged commit 350c5cb into main Sep 9, 2026
22 checks passed
@gaborbernat
gaborbernat deleted the test/driver-mutants-1893-b branch September 9, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant