Fix overridable configuration testing - #13516
Open
bneradt wants to merge 1 commit into
Open
Conversation
The overridable configuration regression test writes arbitrary values to each setting and expects exact round trips. That forced the server match converter to retain out-of-range enum values, which can break connection-group hashing and equality in production. This patch replaces the regression test with Catch coverage that checks the full name/key/type map and representative public setter and getter paths with valid values. It also adds focused converter coverage and clamps server match values to its documented enum range, removing the production workaround for the flawed test. Fixes: apache#4210
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a flawed overridable-configuration regression test that required preserving out-of-range enum values, which in turn prevented proper range checking and could break connection-group hashing/equality in production. It replaces that coverage with Catch2 unit tests that validate the overridable config name/key/type map and representative setter/getter paths using valid values, and it restores correct clamping behavior for the per-server connection match converter.
Changes:
- Add Catch2 unit tests for the HTTP overridable configuration lookup and representative set/get APIs.
- Add focused unit test coverage for
ConnectionTrackerserver-match conversion, and clamp invalid integer values to the documented enum range. - Remove the legacy InkAPITest regression that enforced invalid round-trips and add the new API unit test target to the build.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/iocore/net/unit_tests/test_ConnectionTracker.cc | Adds Catch2 coverage for server match converter round-trips and clamping behavior. |
| src/iocore/net/ConnectionTracker.cc | Restores correct clamping of server match values in SERVER_MATCH_CONV. |
| src/iocore/net/CMakeLists.txt | Includes the new ConnectionTracker unit test source in the net test target. |
| src/api/unit_tests/test_HttpOverridableConfig.cc | Adds Catch2 tests for overridable config discovery and representative int/float/string set/get paths (including clamped enum). |
| src/api/InkAPITest.cc | Removes the legacy overridable-config regression test that depended on accepting arbitrary out-of-range values. |
| src/api/CMakeLists.txt | Adds a new Catch2 test executable/ctest entry for the overridable-config API unit tests. |
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.
The overridable configuration regression test writes arbitrary values to
each setting and expects exact round trips. That forced the server match
converter to retain out-of-range enum values, which can break
connection-group hashing and equality in production.
This patch replaces the regression test with Catch coverage that checks
the full name/key/type map and representative public setter and getter
paths with valid values. It also adds focused converter coverage
and clamps server match values to its documented enum range, removing
the production workaround for the flawed test.
Fixes: #4210