test(hosts): use a valid FinalMask noise fixture - #889
Merged
ImMohammad20000 merged 1 commit intoSep 12, 2026
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Sep 9, 2026
x0sina
added a commit
that referenced
this pull request
Sep 12, 2026
) * feat(user): enhance user inbound tag retrieval and subscription update handling - Improved the `inbounds` method in the User model to efficiently gather inbound tags from enabled groups. - Updated user subscription update logic to queue updates for background processing, enhancing performance. - Refactored user status change notifications to streamline the process and ensure accurate user state management. - Introduced caching for usage coefficients to optimize node user statistics collection. - Enhanced subscription generation with caching mechanisms for improved performance. * fix: discard stale subscription updates and align FinalMask test (#886) * fix: read flushed subscription updates from a fresh snapshot (#888) * perf(nats): optimize user sync and bound queue processing (#892) Reuse live key indexes, replay snapshots in bounded batches, and clear queues from cached keys and recent revisions. Bound bulk operations, safely compact old deletion markers, and preserve claim recovery across delayed notifications and reconnects. Add concurrency, recovery, compaction, and idle-traffic regression coverage. * test(hosts): match FinalMask noise fixture to Xray array packet Keep the #889 payload ([1, 2, 255], no rand) so it agrees with the merged assertions after pref-boost picked up both that change and the older #886 sample. * fix(cleanup): add timeout handling for node-sync key compaction and improve logging - Introduced asyncio timeout for the compaction process to prevent indefinite blocking. - Added a warning log for timeout occurrences to ensure visibility of potential issues. - Updated Cache-Control header in subscription responses to "no-store" for better caching behavior. - Refactored subscription update buffer to use a drain lock for concurrent flush operations, improving reliability and performance. --------- Co-authored-by: DrSaeedHub <122322581+DrSaeedHub@users.noreply.github.com>
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.
Problem
tests/api/test_host.py::test_host_finalmask_new_typesusedtype: "rand"for a FinalMask noise item. Cleanorigin/devrejects that fixture with a Pydanticstring_pattern_mismatch, so the same baseline test fails independently of the feature changes in #758 and #879.Xray treats FinalMask noise
typeas the packet encoding (array,str,hex, orbase64). Random padding is configured through the separaterandfield, and the documented contract sayspacketandrandconflict:Change
Use a valid
arraypacket in the existing API fixture and verify its POST/GET serialization. The assertion also confirms that the serialized item does not acquire a random-padding value or the Freedom-onlyapply_tofield.This is a test-only compatibility correction. The production
FinalMaskNoiseItemmodel onorigin/devalready matches Xray's accepted type values, so no application code or dependencies change.Validation
python -m pytest -q --tb=short tests/api/test_host.py::test_host_finalmask_new_types— 1 passedFinalMaskNoiseItemvalidation — valid array packet accepted; priortype: "rand"fixture rejected withstring_pattern_mismatchpython -m ruff check tests/api/test_host.py— passedpython -m ruff format --check tests/api/test_host.py— passedgit diff --check— passed