fix(test): match JWT metrics stubs to public API - #86
Merged
Merged
Conversation
thegoodengineer
left a comment
Collaborator
There was a problem hiding this comment.
LGTM! Properly aligns the metrics test doubles with the public signatures in metrics.h and resolves -Werror=lto-type-mismatch under LTO builds.
Member
|
LGTM. +11 lines, -3 lines. That's a small patch. IMO we can merge this right now. |
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
Fix the metrics test doubles in
tests/test_middleware_jwt.cto match the public API. Includemetrics.hso later signature drift is diagnosed during compilation, including builds without LTO.The old stubs omitted the metric ID parameter from
cwist_metric_incand used the wrong parameter count/types forcwist_metric_add. The registry stub also returned an untyped pointer. The stubs remain no-ops; JWT assertions and runtime code are unchanged. No compiler warning or sanitizer check is disabled.Reproduction
On pristine dev
65632aed0a30e8aabe1519aa9b706e19685c2b4b, Linux/aarch64 GCC with the repository's normal optimization/LTO flags:The library builds, but linking the test fails with
-Werror=lto-type-mismatchforcwist_metric_incandcwist_metric_add. The same failure reproduces in the #84 integration tree. Fresh source timestamps forced rebuilds; an earlier stale-build control was discarded.Validation
test_middleware_jwt,test_jwt,test_metricsall pass withWERROR=1.This is a test-only prerequisite found while validating #84 during the #25 investigation, not a P99.999 latency fix. It does not restore FIXED caching or change runtime defaults.