Skip to content

Fix overridable configuration testing - #13516

Open
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:overridable-config-catch-tests
Open

Fix overridable configuration testing#13516
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:overridable-config-catch-tests

Conversation

@bneradt

@bneradt bneradt commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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

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
Copilot AI lite review requested due to automatic review settings August 7, 2026 18:53
@bneradt bneradt added this to the 11.0.0 milestone Aug 7, 2026
@bneradt bneradt self-assigned this Aug 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ConnectionTracker server-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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overrideable configuration testing

2 participants