Repository navigation
fix(tools): validate corpus checker timeout as finite positive float (#585) - #586
Merged
LunaStev merged 1 commit intoSep 11, 2026
Conversation
…avefnd#585) Signed-off-by: DYNOSuprovo <[email protected]>
Member
|
LGTM. This overlaps with #587, which addresses the same #585 timeout validation issue. Both approaches are functionally correct, but this implementation is cleaner overall: validation is kept at the argparse type boundary through a dedicated parser, Because the two PRs are duplicates, I’m proceeding with this one and will close #587 in favor of it. |
Open
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
Validate the
--timeoutCLI option intools/check_wave_corpus.pyto ensure it receives a finite positive floating-point number (> 0), producing a concise argparse usage error upon invalid input.Fixes #585.
Motivation
Previously,
check_wave_corpus.pyusedtype=floatwithout validation for--timeout, accepting0, negative values,nan,inf, and-inf. These non-positive or non-finite values fail to provide a finite positive per-file budget and were forwarded down to subprocess execution. Validating at the CLI boundary ensures actionable diagnostic errors before process creation or compiler discovery.Target and compatibility impact
check_wave_corpus.pyrejects non-positive (<= 0) and non-finite (nan,inf,-inf) timeouts with exit status 2 and an error message naming--timeout.0.25) and the 15.0-second default remain unchanged.Validation
tools/test_check_wave_corpus.pycovering:0,0.0,-0.0), negative values (-1,-0.001), NaN (nan,NaN,-nan), infinities (inf,-inf,Infinity), and non-numeric strings with exit code 2 and no tracebacks.main()beforeresolve_wavecis invoked.--helpoutput.python3 -m unittest tools.test_check_wave_corpus(5 passed).python3 -m unittest discover -s tools -p "test_*.py"(38 passed).Checklist
Signed-off-byline.std/.