test: inject Win32 failures to cover every error path - #23
Merged
Merged
Conversation
`sys::fault`, compiled only for tests, fails the Nth fallible wrapper call on the current thread; each wrapper checks it on entry (ADR 0012). `failure_tests` fails every call of every public operation in turn and requires the injected error back, and an isolated run requires an unchanged handle count. Other tests close the remaining gaps: - Real failures cover logic after a Win32 call: handles without the needed access, a full attribute list, an oversized attribute count, unterminated paths. - Stored handle duplicates are checked to be non-inheritable; `more.com`, application-directory, and NUL-path resolution are covered. - ConPTY probes check the console size, so a spawn missing the pseudoconsole attribute fails instead of hanging. - A test that runs first checks a running spawn is not suspended. - Isolated reruns carry their marker as both an argument and a variable, so an environment mutant cannot make them recurse. `.rust-mutants.toml` records the surviving mutants no test can observe, each with its equivalence or unreachability, and skips three unreachable lines and one endless loop. `storage_words` uses `div_ceil` and can no longer fail. On Windows the run now reports killed 558, survived 14 (all expected), waited 11, errored 2. Every waited mutant has a recorded failing test; rust-mutants still reports it as waited because a later test hangs (reported upstream), as it does the two out-of-bounds panics.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The pipe operation read to EOF, so its number of reads depended on how the pipe split the output, and a failure index could miss. It now writes and reads once each. The pseudoconsole operation created and closed a console per run; ClosePseudoConsole can block on some Windows Server 2022 builds, and the blocked close threads held handles that the leak check counted. One console now serves every run.
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.
Summary
Closes the mutation findings the first rust-mutants run reported (ADR 0012).
sys::fault(tests only) fails the Nth fallible wrapper call on the current thread.failure_testsfails every call of every public operation in turn and requires the injected error back; an isolated run requires an unchanged handle count.more.com, application-directory, and NUL-path resolution are covered..rust-mutants.tomlrecords each survivor no test can observe with its equivalence or unreachability, and skips three unreachable lines and one endless loop.Validation
Windows 11 Pro build 26200, through domyjob:
cargo xtask testand the lib tests pass.Every waited mutant has a recorded failing test and is reported as waited only because a later test in the same process hangs; this and the two out-of-bounds panics reported as errored are with njutest.
macOS:
cargo clippy --workspace --all-targets -- -D warningsforx86_64-pc-windows-msvc;cargo +1.75 check --workspace --all-targets.Checklist
just ciandjust coveragewhen applicable. (cargo xtask teston Windows; the rest is left to CI.)