🧪 test(driver): close the jobs and rate-limit survivors - #2254
Merged
Conversation
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
Merging this PR will not alter performance
Comparing Footnotes
|
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.
A fresh
cargo mutants -p peryx-driverpass overjobs/mod.rsandrate_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
JobReportliteral 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::changedfor a run whose changed count equals its processed count andJobReport::examinedfor 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_proxyhad no caller in the crate;peryx-httpasks it before reading forwarded headers. A limiter answering a constant either way passed the suite, so one case now pins both answers. The twoActorKey::kindsurvivors 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