test: update test_range_search_only_range_filter to verify reject behavior#49053
Open
yanliang567 wants to merge 1 commit intomilvus-io:masterfrom
Open
test: update test_range_search_only_range_filter to verify reject behavior#49053yanliang567 wants to merge 1 commit intomilvus-io:masterfrom
yanliang567 wants to merge 1 commit intomilvus-io:masterfrom
Conversation
…avior Before fix milvus-io#48915, range_filter without radius was silently ignored by the C++ core, which fell back to regular top-K search and returned results violating the range_filter constraint (e.g. self-match distance=1.0 with range_filter=0.5). Fix commit 4d958bb added proxy-layer validation that rejects such requests with ErrParameterInvalid (code=1100). Update the test to match the new behavior: assert that search with range_filter but no radius fails with the expected error code and message for both COSINE and IP metrics. issue: milvus-io#48915 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: yanliang567 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Contributor
|
[ci-v2-notice] To rerun ci-v2 checks, comment with:
If you have any questions or requests, please contact @zhikunyao. |
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
Updates
test_range_search_only_range_filterto match the new server behavior introduced by fix commit4d958bb(issue #48915).issue: #48915
What changed and why
Before (original test behavior):
search_params={"range_filter": 0.5}(noradius) and expected successrange_filterwithoutradiusand returned self-matches withdistance=1.0, violating the filter constraintassert hit["distance"] <= 0.5always failed on the self-match)After fix
4d958bb(new server behavior):range_filterwithoutradiuswithErrParameterInvalid(code=1100)"range_filter requires radius to be set; range_filter alone is not a valid range search parameter"This PR updates the test to verify the correct rejection behavior:
err_code=1100anderr_msgcontains"range_filter requires radius to be set"for COSINE metricCI failure
The test was failing in nightly CI (
master-20260414-80af30b) with:Because the test expected success but the server now correctly rejects the request.
Test Plan
4d958bb🤖 Generated with Claude Code