fix(httpapi): flaky activation scope assertion - #1329
Merged
Dumbris merged 2 commits intoSep 21, 2026
Merged
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Replace the regex-based NotRegexp check with two plain NotContains calls for the same boundary condition, matching every other assertion in this file. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Member
|
Thanks for the fix, @lux-liang! Nice catch on the timestamp false-positive. I pushed a small follow-up commit simplifying the leak-check assertion to two plain |
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.
Pull Request
Description
Fixes #1206.
The scoped
/api/v1/statustest searched the entire JSON response for the baredigits
4711. A Unix timestamp containing those digits could therefore failthe test even though the deployment-wide counter was correctly withheld.
This change matches a complete JSON numeric value instead. It still catches the
count if a projection exposes it under a renamed key, while ignoring the same
digits embedded in a larger timestamp.
Testing
Passing checks:
go test ./internal/httpapi -run '^TestGetStatus_ActivationBlockIsOperatorOnly$' -count=50go test -race ./internal/httpapi -run '^TestGetStatus_ActivationBlockIsOperatorOnly$' -count=20go test ./internal/httpapi -count=1go vet ./internal/httpapigolangci-lint run --new-from-rev=HEAD ./internal/httpapi/...go test ./internal/...was also attempted. The target package passed, whileunrelated environment-sensitive tests failed because the test host runs as
root (read-only-directory assertions), uses
/var/log/mcpproxy, and did nothave the prebuilt E2E binary expected by
internal/server.