test(mitos): cover connect_timeout_ms bounds in WireConfig::validate - #88
Merged
Conversation
check_connect_timeout_ms enforces CONNECT_TIMEOUT_MS_BOUNDS at runtime and is wired into WireConfig::validate, but no test asserted on it - wire_bounds_are_enforced_at_both_ends covers max_header_bytes, key_response_body_multiplier, and response_read_chunk_bytes, skipping connect_timeout_ms entirely. The validator could be deleted or inverted and the suite would stay green. Adds coverage for both rejection ends (below the floor, above the ceiling), both inclusive boundary values (exact min and max accepted), and the 0 sentinel (disables the deadline, deliberately outside the range, always admissible).
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.
Refs #55
check_connect_timeout_msenforcesCONNECT_TIMEOUT_MS_BOUNDSat runtime and is correctly wired intoWireConfig::validate(crates/mitos/src/config/mod.rs), but no test asserted on it.wire_bounds_are_enforced_at_both_endscoversmax_header_bytes,key_response_body_multiplier, andresponse_read_chunk_bytes— skippingconnect_timeout_msentirely. The validator could be deleted or inverted and the suite would stay green.Adds three tests:
connect_timeout_ms_bounds_are_enforced_at_both_ends— a value below the floor and a value above the ceiling are both rejected with the exactConfigError::OutOfRangevariantconnect_timeout_ms_at_the_bounds_is_accepted— the exact min and max are both accepted (inclusive-bound check)connect_timeout_ms_zero_is_admissible_as_the_disabled_sentinel—0(the disabled-deadline sentinel, deliberately outsideCONNECT_TIMEOUT_MS_BOUNDS) is acceptedNo functional change — test-only.