Skip to content

test: update test_range_search_only_range_filter to verify reject behavior#49053

Open
yanliang567 wants to merge 1 commit intomilvus-io:masterfrom
yanliang567:test/fix-range-filter-only-range-filter-case
Open

test: update test_range_search_only_range_filter to verify reject behavior#49053
yanliang567 wants to merge 1 commit intomilvus-io:masterfrom
yanliang567:test/fix-range-filter-only-range-filter-case

Conversation

@yanliang567
Copy link
Copy Markdown
Contributor

Summary

Updates test_range_search_only_range_filter to match the new server behavior introduced by fix commit 4d958bb (issue #48915).

issue: #48915

What changed and why

Before (original test behavior):

  • Sent search_params={"range_filter": 0.5} (no radius) and expected success
  • This was testing the bug: the C++ core silently ignored range_filter without radius and returned self-matches with distance=1.0, violating the filter constraint
  • The test was verifying broken behavior (assert hit["distance"] <= 0.5 always failed on the self-match)

After fix 4d958bb (new server behavior):

  • The proxy layer now rejects range_filter without radius with ErrParameterInvalid (code=1100)
  • Error: "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:

  • Asserts err_code=1100 and err_msg contains "range_filter requires radius to be set" for COSINE metric
  • Also covers IP metric (same validation path)

CI failure

The test was failing in nightly CI (master-20260414-80af30b) with:

MilvusException: (code=1100, message=range_filter requires radius to be set; ...)

Because the test expected success but the server now correctly rejects the request.

Test Plan

  • Verified test is collected without syntax errors
  • Logic matches the proxy validation added in 4d958bb

🤖 Generated with Claude Code

…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>
@sre-ci-robot
Copy link
Copy Markdown
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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sre-ci-robot sre-ci-robot added area/test size/M Denotes a PR that changes 30-99 lines. sig/testing labels Apr 15, 2026
@mergify mergify bot added dco-passed DCO check passed. kind/test labels Apr 15, 2026
@sre-ci-robot
Copy link
Copy Markdown
Contributor

[ci-v2-notice]
Notice: New ci-v2 system is enabled for this PR.

To rerun ci-v2 checks, comment with:

  • /ci-rerun-code-check // for ci-v2/code-check
  • /ci-rerun-build // for ci-v2/build
  • /ci-rerun-build-all // for ci-v2/build-all (multi-arch builds)
  • /ci-rerun-buildenv // for ci-v2/build-env (build milvus-env builder images)
  • /ci-rerun-ut-integration // for ci-v2/ut-integration, will rerun ci-v2/build
  • /ci-rerun-ut-go // for ci-v2/ut-go, will rerun ci-v2/build
  • /ci-rerun-ut-cpp // for ci-v2/ut-cpp
  • /ci-rerun-ut // for all ci-v2/ut-integration, ci-v2/ut-go, ci-v2/ut-cpp, will rerun ci-v2/build
  • /ci-rerun-e2e-default // for ci-v2/e2e-default
  • /ci-rerun-e2e-amd // for ci-v2/e2e-amd (e2e pool dispatcher)
  • /ci-rerun-build-ut-cov // for ci-v2/build-ut-cov (build + unit tests in one pipeline)
  • /ci-rerun-gosdk // for ci-v2/go-sdk (Go SDK E2E tests, ARM)

If you have any questions or requests, please contact @zhikunyao.

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

Labels

approved area/test dco-passed DCO check passed. kind/test sig/testing size/M Denotes a PR that changes 30-99 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants