Commit Graph

1275 Commits (17532517c611cafe5ec7a79bda47c9f296e82682)

Author SHA1 Message Date
Xiaofan 23d2553e4e
test: fix flaky test_hybrid_search_as_search on ARM (#48173)
## What does this PR do?

Fix a flaky test in `test_milvus_client_hybrid_search_v2.py`.

## Why?

`test_hybrid_search_as_search` asserts that hybrid search (single field
+ WeightedRanker) returns the same ordered result list as a regular
search. When two results have tied scores, tie-breaking order is
non-deterministic across architectures and runs due to floating-point
differences — this causes spurious failures on ARM e2e CI.

Comparing ID sets instead of ordered lists preserves the intent of the
test (same result candidates returned) while being robust to ordering of
ties.

---------

Signed-off-by: xiaofanluan <xiaofan.luan@zilliz.com>
2026-03-17 10:25:26 +08:00
Li Yiyang d1be390452
test: Migrate partition key test cases from v1 ORM to v2 MilvusClient (#48182)
## Summary
- Migrate 15 partition key test cases from
`testcases/test_partition_key.py` (v1 ORM style) to
`milvus_client/test_milvus_client_partition_key.py` (v2 MilvusClient
style)
- Migrate 4 partition key isolation test cases from
`testcases/test_partition_key_isolation.py` to
`milvus_client/test_milvus_client_partition_key_isolation.py`
- Optimize isolation test parameters to prevent CI timeout: data_size
10000→1000, dim 768→128, HNSW M=30→16, efConstruction=360→64
- Remove migrated v1 test files

## Related Issues
#48048

## Test plan
- [x] All 19 migrated test cases (46 parametrized combinations) pass on
cluster (19531)
- [x] Partition key isolation tests (4 cases) all pass (~68s total, down
from >360s CI timeout)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: lyyyuna <yiyang.li@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 10:39:39 +08:00
Li Yiyang 260c312da7
test: Migrate partition test cases from v1 ORM to v2 MilvusClient (#48138)
## Summary
- Migrate 50+ partition test cases from `testcases/test_partition.py`
(v1 ORM style) to `milvus_client/test_milvus_client_partition.py` (v2
MilvusClient style)
- Add `gen_default_rows_data_for_upsert` helper in `common_func.py` for
row-based upsert data generation
- Enhance existing v2 tests with partition name validation and `None`
partition name coverage
- Remove migrated test cases from v1 file, keeping only v2-incompatible
cases (description params, dataframe insert)

## Related Issues
#48048

## Test plan
- [x] v1 remaining tests pass on standalone (19530) and cluster (19531)
- [x] v2 full test suite passes on standalone (148 passed, 3 failed -
replica tests need cluster)
- [x] v2 full test suite passes on cluster (151 passed, 0 failed)
- [x] v2 tests pass with 8-worker concurrency (`-n 8`) on both
environments

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: lyyyuna <yiyang.li@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 17:01:24 +08:00
Chun Han 65f0df9f17
fix: empty result set crashes Milvus on GROUP BY aggregation query (#48050)
## Summary

Fixes #47316

- **GroupingSet::outputRowCount()**: Add null check for `lookup_` to
prevent SIGSEGV when filter matches zero rows and no input data arrives
- **ExecPlanNodeVisitor::setupRetrieveResult()**: When query result is
nullptr, build empty field_data arrays with correct schema (0 rows, N
columns) so downstream receives proper column structure instead of
missing columns
- Enable previously skipped E2E test `test_empty_result_aggregation`

## Test plan

- [x] E2E test `test_empty_result_aggregation` passes (GROUP BY +
aggregation with filter matching 0 rows returns empty result `[]`)
- [ ] Existing aggregation E2E tests still pass
- [ ] CI green

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: MrPresent-Han <chun.han@gmail.com>
Co-authored-by: MrPresent-Han <chun.han@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 22:31:24 +08:00
Chun Han 552cba98a0
fix: count(*) returns wrong result when queried with count(nullable_f… (#47881)
related: #47509
related: #47539

Signed-off-by: MrPresent-Han <chun.han@gmail.com>
Co-authored-by: MrPresent-Han <chun.han@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 14:25:20 +08:00
yanliang567 7d22e53c99
test: Add GROUP BY on nullable field tests to verify fix for issue #47350 (#47856)
## Summary

Add 4 test cases to `TestQueryAggregationSharedV2` covering GROUP BY on
nullable fields, verifying the fix for #47350 (PR #47445).

**Related issue**: #47350

### Changes

**Schema additions** to the shared collection:
- `c10_nullable_varchar`: VARCHAR (nullable, 7 unique values + ~15%
NULL)
- `c11_nullable_int16`: INT16 (nullable, 5 unique values + ~15% NULL)

**New tests:**

| Test | What it verifies |
|------|-----------------|
| `test_group_by_nullable_varchar_field` | GROUP BY nullable VARCHAR
returns actual values (not all NULL) + aggregation correctness |
| `test_group_by_nullable_int16_field` | GROUP BY nullable INT16 returns
actual values + aggregation correctness |
| `test_multi_column_group_by_with_nullable_field` | Multi-column GROUP
BY with one nullable column |
| `test_search_group_by_nullable_field` | Search with GROUP BY on
nullable field returns actual group values |

### Test Plan

- [x] All 4 new tests passed against Milvus 2.6.6
- [x] All 28 existing tests still pass (0 regressions)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
2026-02-25 19:12:46 +08:00
yanliang567 9ef7e25778
test: enable search by ids on null vectors tests for #47065 (#47559)
## Summary
- Enable search by ids tests that were commented out pending fix of
#47065
- Fix syntax error in test: `for i in len()` → `for i in range(len())`
- Update test expectations to match the fixed behavior:
  - Search on null vectors now returns empty results instead of error
- Fix assertion to use correct `num_entities_with_not_null_vector` count

## Test plan
- [x] `test_milvus_client_add_nullable_vector_field_search` - verified
passing
- [x] `test_milvus_client_collection_null_vector_field_search` -
verified passing

issue: #47065

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Signed-off-by: Yan Liang <yanliang@zilliz.com>
Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 14:17:49 +08:00
zhuwenxing fc11816690
test: add test cases for alter function with invalid mock (#46995)
## Summary
- Add mock TEI server utility (`common/mock_tei_server.py`) for testing
text embedding functions
- Add test cases for PR #46984 fix (alter function when other function
is invalid)

## Test Cases
1. `test_alter_function_when_other_function_is_invalid` - Verify that
altering a valid function succeeds even when another function in the
collection is invalid
2. `test_alter_invalid_function_to_valid_endpoint` - Verify that users
can fix an invalid function by altering it to a valid endpoint

## Related Issues
- Issue: https://github.com/milvus-io/milvus/issues/46949
- Fix PR: https://github.com/milvus-io/milvus/pull/46984

## Test Plan
- [x] Verified test fails with unfixed Milvus
(`master-20260112-7bcd3b10`)
- [x] Verified test passes with fixed Milvus (`master-20260112-b39ecb0`)

---------

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2026-02-03 16:29:59 +08:00
yanliang567 d81e6d3996
test: Optimize query aggregation tests and add count(*) validation (#47355)
## Summary

Optimized query aggregation test structure by consolidating negative
tests into shared collection, adding count(*) validation, and
eliminating test redundancy.

**Related issue**: #47353

## Key Improvements

### 1. Test Structure Optimization
- **Moved 7 negative tests** to TestQueryAggregationSharedV2 (uses
shared collection)
  - test_group_by_field_not_in_output_fields
  - test_unsupported_vector_field
  - test_unsupported_aggregation_function_varchar
  - test_mixed_aggregation_and_non_aggregation_fields
  - test_invalid_aggregation_function_syntax
  - test_unsupported_float_type_for_groupby
  - test_unsupported_double_type_for_groupby
- **Deleted redundant test** (test_nullable_field_aggregation - covered
by shared collection)
- **Deleted entire class** TestQueryAggregationNegativeV2

### 2. count(*) Functionality Validation
Added 3 new L1 tests to validate compatibility between original count(*)
feature and new aggregation:
- `test_count_star_without_group_by` - Validates original count(*)
global counting feature
- `test_count_star_vs_count_field` - Validates difference on nullable
fields
  - count(*) = 3000 (includes NULL rows)
  - count(c2) = 2568 (excludes NULL values)
- `test_count_star_with_group_by_error` - Validates proper error when
count(*) used with GROUP BY

### 3. Test Deduplication
- **Deleted** `test_filter_and_limit_with_aggregation` (L2/xfail,
redundant)
- **Enhanced** `test_group_by_with_limit` to cover both scenarios:
  - Scenario 1: limit without filter
- Scenario 2: limit with filter (validates aggregation from filtered
data)
- Eliminated redundant independent collection creation

### 4. Performance Benefits
- **~10-15 seconds faster** per test run (eliminated 8 collection
create/drop cycles)
- **~420 lines removed** (duplicate code: ~350 + ~73)
- **Simplified structure** from 3 test classes to 2

## Changes

**Modified Files:**
- `tests/python_client/testcases/test_query_aggregation.py`
  - TestQueryAggregationSharedV2: 26 tests (+9: 17 → 26)
- TestQueryAggregationIndependentV2: 2 tests (-1: only JSON/Array
remain)
  - Total: 28 tests (29 → 28, -1 due to deduplication)

## Test Plan

- [x] All L0 tests passing: 3 passed in 6.78s
- [x] All L1 tests passing: 20 passed, 2 skipped, 1 xfailed
- [x] New count(*) tests validate:
  - count(*) returns total entity count (3000)
- count(*) vs count(field) difference on nullable fields (3000 vs 2568)
  - count(*) + GROUP BY properly returns error
- [x] Enhanced test_group_by_with_limit covers both limit scenarios
- [x] All moved negative tests still validate error messages correctly
- [x] Shared collection tests remain isolated via xdist_group marker

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
2026-01-28 13:25:32 +08:00
pymilvus-bot 45f326d9d7
test: Increase PyMilvus version to 2.7.0rc122 for master branch (#47300)
Automated daily bump from pymilvus master branch. Updates
tests/python_client/requirements.txt.

---------

Signed-off-by: pymilvus-bot <pymilvus@zilliz.com>
2026-01-27 16:31:32 +08:00
jiamingli-maker 7aa115c7b7
test: migrate advanced upsert valid cases from ORM (#47265)
/kind improvement
/assign @yanliang567 

**PR Summary**
Migrate advanced upsert valid test cases from ORM-based implementation.
- concurrent upserts on the same primary key
- multiple upsert operations
- dynamic field support
- default and None value handling
- sparse vector upsert cases

Signed-off-by: zilliz <jiaming.li@zilliz.com>
2026-01-23 14:41:30 +08:00
jiamingli-maker cebbe1e4da
test: migrate core upsert valid cases from ORM-based cases (#47199)
/kind improvement
/assign @yanliang567 

**PR Summary**
Migrate core upsert valid test cases from ORM-based implementation.
- upsert with non-existing / existing primary keys
- upsert with auto_id enabled
- upsert with string primary key
- upsert with binary vector data
- upsert with data identical to inserted data
- upsert in specific or mismatched partitions

---------

Signed-off-by: zilliz <jiaming.li@zilliz.com>
2026-01-23 08:57:31 +08:00
jiamingli-maker cc9fee32cb
test: migrate upsert invalid test cases from orm (#47185)
/kind improvement
/assign @yanliang567 

**PR Summary**
- Migrated upsert invalid test cases including:
  - data type mismatch
  - vector type / dimension mismatch
  - binary vector dimension mismatch
  - auto_id primary key type mismatch
  - rows using invalid type default value

---------

Signed-off-by: zilliz <jiaming.li@zilliz.com>
2026-01-21 14:01:30 +08:00
jiamingli-maker 71e4bcf286
test: migrate insert array cases and remove migrated string field insert cases (#47173)
/kind improvement
/assign @yanliang567 

**PR Summary**

- Removed migrated ORM-based test class TestInsertString(TestcaseBase)
- Added MilvusClient-based insert array test cases:
  - `test_milvus_client_insert_array_data`
  - `test_milvus_client_insert_array_empty_field`
  - `test_milvus_client_insert_array_length_differ`
  - `test_milvus_client_insert_array_length_invalid`
  - `test_milvus_client_insert_array_type_invalid`
  - `test_milvus_client_insert_array_mixed_value`

---------

Signed-off-by: zilliz <jiaming.li@zilliz.com>
2026-01-21 13:59:35 +08:00
Feilong Hou bf996cb8a0
test: create e2e case for truncate collection (#47035)
Issue: #47034 
 1. Create e2e cases for truncate collection
 2. Connect necessary sdk function to milvus client wrapper

 On branch feature/truncate
 Changes to be committed:
	modified:   base/async_milvus_client_wrapper.py
	modified:   base/client_v2_base.py
	modified:   milvus_client/test_milvus_client_collection.py
	modified:   testcases/async_milvus_client/test_collection_async.py

---------

Signed-off-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Eric Hou <eric.hou@zilliz.com>
2026-01-19 19:19:29 +08:00
jiamingli-maker 533e094cda
test: migrate string insert cases and refactor async insert tests (#47110)
/kind improvement
/assign @yanliang567 

**PR Summary**

- Migrate TestInsertString ORM cases to client v2:
  - `test_milvus_client_insert_string_field_is_primary`
  - `test_milvus_client_insert_multi_string_fields`
  - `test_milvus_client_insert_string_field_length_exceed`
  - `test_milvus_client_insert_string_field_space_empty`
  - `test_milvus_client_insert_string_field_is_pk_and_empty`
- Split async insert tests into
testcases/async_milvus_client/test_insert_async.py

Signed-off-by: zilliz <jiaming.li@zilliz.com>
2026-01-19 17:03:30 +08:00
jiamingli-maker 618153ae54
test: migrate invalid insert test cases to TestMilvusClientInsertInvalid (#47098)
/kind improvement
/assign @yanliang567 

**PR Summary**
Migrate invalid insert test cases to TestMilvusClientInsertInvalid:
- `test_insert_with_invalid_field_value`
- `test_insert_over_resource_limit`
- `test_insert_type_mismatch_with_default_value_field`
- `test_insert_with_nan_value`
- `test_invalid_sparse_vector_data`

---------

Signed-off-by: zilliz <jiaming.li@zilliz.com>
2026-01-19 11:01:30 +08:00
jiamingli-maker 53e6e6ab9c
test: migrate binary and integer overflow insert cases (#47051)
/kind improvement
/assign @yanliang567 

**PR Summary**

- This PR migrates ORM-based insert test cases to the Milvus client API,
including binary vector inserts, repeated binary vector inserts, binary
vector index creation, invalid binary scenarios, and integer overflow
validation (int8/int16/int32):
  - `test_insert_binary_partition`
  - `test_insert_binary_multi_times`
  - `test_insert_binary_create_index`
  - `test_insert_int8_overflow`
  - `test_insert_int16_overflow`
  - `test_insert_int32_overflow`
  - `test_insert_ids_binary_invalid`
  - `test_insert_with_invalid_binary_partition_name`

---------

Signed-off-by: zilliz <jiaming.li@zilliz.com>
2026-01-15 18:51:28 +08:00
jiamingli-maker efcd39b711
test: fix insert resource-limit expectation and add async insert testcases (#47047)
/kind improvement
/assign @yanliang567 

**PR Summary**

- Fix mismatched expectations in the insert resource-limit test.
- Migrate async insert test cases from ORM-based cases, including normal
insert, large insert, invalid data, and invalid partition scenarios.

---------

Signed-off-by: zilliz <jiaming.li@zilliz.com>
2026-01-15 18:49:34 +08:00
jiamingli-maker 3e7d9d4a12
test: refine partition insert testcases and add all-datatype case (#47000)
\kind improvement
\assign @yanliang567 

- Skip duplicated partition insert tests:
- test_insert_default_partition (covered by
test_milvus_client_insert_partition)
- test_insert_partition_not_existed (covered by
test_milvus_client_insert_not_exist_partition_name)

- Fix the docstring of
test_milvus_client_insert_not_exist_partition_name to correctly describe
insert behavior with a non-existent partition.

- Strengthen assertions for partition insert tests:

  - Verify total entity count after inserting into multiple partitions.

  - Validate returned primary key IDs when inserting with explicit IDs.

- Fix mismatched test expectations in
`test_insert_auto_id_false_same_values` by aligning the docstring with
actual behavior.
- Add test_insert_all_datatype_collection to validate insert behavior
for collections containing all supported data types using row-based
client insert.

Signed-off-by: zilliz <jiaming.li@zilliz.com>
2026-01-14 11:53:29 +08:00
jiamingli-maker 6e2a3abc2f
test: fix insert case labels, add field-name mismatch test (#46998)
/kind improvement
/assign @yanliang567 

**PR Summary**

- Skip duplicated client insert tests already covered by existing cases
(e.g. insert after client closed, missing vector field, auto-ID
scenarios).
- Fix test docstrings to accurately describe vector field missing and
vector data type mismatch behaviors.
- Migrate a client insert test (`test_insert_field_name_not_match`).
- Fix CaseLabel tagging to keep consistent with the original ORM-based
testcases.

Signed-off-by: zilliz <jiaming.li@zilliz.com>
2026-01-14 11:51:26 +08:00
jiamingli-maker 2a647751b1
test: add insert testcases for binary vector and none datatype (#46964)
/kind improvement
/assign @yanliang567 

**PR Summary**

- migrate Binary vector insert with schema dimension mismatch.
- migrate insert with None data.
- add `test_milvus_client_insert_binary_default` to cover BINARY_VECTOR,
which was not included in `test_milvus_client_insert_default` (covered
FLOAT_VECTOR, FLOAT16_VECTOR, BFLOAT16_VECTOR, and INT8_VECTOR

Signed-off-by: zilliz <jiaming.li@zilliz.com>
2026-01-12 09:47:27 +08:00
Li Liu 7411e904b6
enhance: support search_by_pk for BM25 (#46937)
issue: #39157

Signed-off-by: Li Liu <li.liu@zilliz.com>
2026-01-09 18:59:26 +08:00
zhuwenxing 3b12286369
test: use minio_bucket parameter in bulk insert TEI tests (#46862)
/kind improvement

Replace hardcoded "milvus-bucket" with minio_bucket fixture parameter in
testcases

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2026-01-08 16:31:26 +08:00
foxspy 53a300db83
enhance: update knowhere version (#45564)
issue: #42937 

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
- Core invariant: callers must explicitly close output streams (call
Close()) instead of relying on RemoteOutputStream's destructor to
perform closure.
- Logic removed/simplified: RemoteOutputStream's destructor no longer
closes or asserts on the underlying arrow::io::OutputStream; an explicit
public Close() method was added and closure responsibility moved to that
code path.
- Why this is safe (no data loss/regression): callers now invoke Close()
before reading or destroying streams (e.g.,
DiskFileManagerTest::ReadAndWriteWithStream calls os->Close() before
opening the input stream). Write paths remain unchanged
(RemoteOutputStream::Write -> output_stream_->Write), and Close invokes
output_stream_->Close() with status assertion, ensuring
flush/confirmation via the same API and preserving data integrity;
removing destructor-side asserts prevents unexpected failures during
object destruction without changing write/close semantics.
- Chore: updated third-party pins — internal/core/thirdparty/knowhere
CMakeLists.txt: KNOWHERE_VERSION -> a59816e;
internal/core/thirdparty/milvus-common CMakeLists.txt:
MILVUS-COMMON-VERSION -> b6629f7.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: xianliang.li <xianliang.li@zilliz.com>
2026-01-07 10:39:24 +08:00
Chun Han b7ee93fc52
feat: support query aggregtion(#36380) (#44394)
related: #36380

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
- Core invariant: aggregation is centralized and schema-aware — all
aggregate functions are created via the exec Aggregate registry
(milvus::exec::Aggregate) and validated by ValidateAggFieldType, use a
single in-memory accumulator layout (Accumulator/RowContainer) and
grouping primitives (GroupingSet, HashTable, VectorHasher), ensuring
consistent typing, null semantics and offsets across planner → exec →
reducer conversion paths (toAggregateInfo, Aggregate::create,
GroupingSet, AggResult converters).

- Removed / simplified logic: removed ad‑hoc count/group-by and reducer
code (CountNode/PhyCountNode, GroupByNode/PhyGroupByNode, cntReducer and
its tests) and consolidated into a unified AggregationNode →
PhyAggregationNode + GroupingSet + HashTable execution path and
centralized reducers (MilvusAggReducer, InternalAggReducer,
SegcoreAggReducer). AVG now implemented compositionally (SUM + COUNT)
rather than a bespoke operator, eliminating duplicate implementations.

- Why this does NOT cause data loss or regressions: existing data-access
and serialization paths are preserved and explicitly validated —
bulk_subscript / bulk_script_field_data and FieldData creation are used
for output materialization; converters (InternalResult2AggResult ↔
AggResult2internalResult, SegcoreResults2AggResult ↔
AggResult2segcoreResult) enforce shape/type/row-count validation; proxy
and plan-level checks (MatchAggregationExpression,
translateOutputFields, ValidateAggFieldType, translateGroupByFieldIds)
reject unsupported inputs (ARRAY/JSON, unsupported datatypes) early.
Empty-result generation and explicit error returns guard against silent
corruption.

- New capability and scope: end-to-end GROUP BY and aggregation support
added across the stack — proto (plan.proto, RetrieveRequest fields
group_by_field_ids/aggregates), planner nodes (AggregationNode,
ProjectNode, SearchGroupByNode), exec operators (PhyAggregationNode,
PhyProjectNode) and aggregation core (Aggregate implementations:
Sum/Count/Min/Max, SimpleNumericAggregate, RowContainer, GroupingSet,
HashTable) plus proxy/querynode reducers and tests — enabling grouped
and global aggregation (sum, count, min, max, avg via sum+count) with
schema-aware validation and reduction.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: MrPresent-Han <chun.han@gmail.com>
Co-authored-by: MrPresent-Han <chun.han@gmail.com>
2026-01-06 16:29:25 +08:00
jiamingli-maker d0e6a624a7
test: Skip HNSW_PRQ test cases (#46771)
/kind improvement
Skipping HNSW_PRQ tests due to index creation timeout.

Signed-off-by: zilliz <jiaming.li@zilliz.com>
2026-01-05 18:55:24 +08:00
yanliang567 7018151c7d
test: Add tests for search by ids (#46756)
related issue: #46755

Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
2026-01-05 13:25:23 +08:00
jiamingli-maker c10cf53b4b
test: Add HNSW_PRQ test cases and fix HNSW_PQ (#46680)
/kind improvement

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
- Core invariant: index parameter validation and test expectations for
the HNSW-family must be explicit, consistent, and deterministic — this
PR enforces that by adding exhaustive parameter matrices for HNSW_PRQ
(tests/python_client/testcases/indexes/{idx_hnsw_prq.py,
test_hnsw_prq.py}) and normalizing expectations in idx_hnsw_pq.py via a
shared success variable.
- Logic removed / simplified: brittle, ad-hoc string expectations were
consolidated — literal "success" occurrences were replaced with a single
success variable and ambiguous short error messages were replaced by the
canonical descriptive error text; this reduces duplicated assertion
logic in tests and removes dependence on fragile, truncated messages.
- Bug fix (tests): corrected HNSW_PQ test expectations to assert the
full, authoritative error for invalid PQ m ("The dimension of the vector
(dim) should be a multiple of the number of subquantizers (m).") and
aligned HNSW_PRQ test matrices (idx_hnsw_prq.py) to the same explicit
expectations — the change targets test assertions only and fixes false
negatives caused by mismatched messages.
- No data loss or behavior regression: only test code is added/modified
(tests/python_client/testcases/indexes/*). Production code paths remain
unmodified — collection creation, insert/flush, client.create_index,
wait_for_index_ready, load_collection, search, and client.describe_index
are invoked by tests but not changed; therefore persisted data, index
artifacts, and runtime behavior are unaffected.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: zilliz <jiaming.li@zilliz.com>
2026-01-04 18:57:22 +08:00
yanliang567 15ce8aedd8
test: Add some tests for group by search support json and dynamic field (#46630)
related issue: #46616


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
- Core invariant: these tests assume the v2 group-by search
implementation (TestMilvusClientV2Base and pymilvus v2 APIs such as
AnnSearchRequest/WeightedRanker) is functionally correct; the PR extends
coverage to validate group-by semantics when using JSON fields and
dynamic fields (see
tests/python_client/milvus_client_v2/test_milvus_client_search_group_by.py
— TestGroupSearch.setup_class and parametrized group_by_field cases).
- Logic removed/simplified: legacy v1 test scaffolding and duplicated
parametrized fixtures/test permutations were consolidated into
v2-focused suites (TestGroupSearch now inherits TestMilvusClientV2Base;
old TestGroupSearch/TestcaseBase patterns and large blocks in
test_mix_scenes were removed) to avoid redundant fixture permutations
and duplicate assertions while reusing shared helpers in common_func
(e.g., gen_scalar_field, gen_row_data_by_schema) and common_type
constants.
- Why this does NOT introduce data loss or behavior regression: only
test code, test helpers, and test imports were changed — no
production/server code altered. Test helper changes are
backward-compatible (gen_scalar_field forces primary key nullable=False
and only affects test data generation paths in
tests/python_client/common/common_func.py; get_field_dtype_by_field_name
now accepts schema dicts/ORM schemas and is used only by tests to choose
vector generation) and collection creation/insertion in tests use the
same CollectionSchema/FieldSchema paths, so production
storage/serialization logic is untouched.
- New capability (test addition): adds v2 test coverage for group-by
search over JSON and dynamic fields plus related scenarios — pagination,
strict/non-strict group_size, min/max group constraints, multi-field
group-bys and binary vector cases — implemented in
tests/python_client/milvus_client_v2/test_milvus_client_search_group_by.py
to address issue #46616.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
2025-12-31 11:03:21 +08:00
jac 898e6d6e94
fix: [master]update ngram test error codes to match actual server responses (#46675)
- Updates e2e test error code and message after pymilvus update

see #46677

Signed-off-by: silas.jiang <silas.jiang@zilliz.com>
Co-authored-by: silas.jiang <silas.jiang@zilliz.com>
2025-12-30 13:07:20 +08:00
jiamingli-maker ebe82db4fe
test: Add HNSW_PQ test cases and update HNSW_SQ (#46604)
/kind improvement

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
- Core invariant: test infrastructure treats insertion granularity as
orthogonal to data semantics—bulk generation
gen_row_data_by_schema(nb=2000, start=0, random_pk=False) yields the
same sequential PKs and vector payloads as prior multi-batch inserts, so
tests relying on collection lifecycle, flush, index build, load and
search behave identically.
- What changed / simplified: added a full HNSW_PQ parameterized test
suite (tests/python_client/testcases/indexes/idx_hnsw_pq.py and
test_hnsw_pq.py) and simplified HNSW_SQ test insertion by replacing
looped per-batch generation+insert with a single bulk
gen_row_data_by_schema(...) + insert. The per-batch PK sequencing and
repeated vector generation were redundant for correctness and were
removed to reduce complexity.
- Why this does NOT cause data loss or behavior regression: the
post-insert code paths remain unchanged—tests still call client.flush(),
create_index(...), util.wait_for_index_ready(), collection.load(), and
perform searches that assert describe_index and search outputs. Because
start=0 and random_pk=False reproduce identical sequential PKs (0..1999)
and the same vectors, index creation and search validation operate on
identical data and index parameters, preserving previous assertions and
outcomes.
- New capability: comprehensive HNSW_PQ coverage (build params: M,
efConstruction, m, nbits, refine, refine_type; search params: ef,
refine_k) across vector types (FLOAT_VECTOR, FLOAT16_VECTOR,
BFLOAT16_VECTOR, INT8_VECTOR) and metrics (L2, IP, COSINE), implemented
as data-driven tests to validate success and failure/error messages for
boundary, type-mismatch and inter-parameter constraints.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: zilliz <jiaming.li@zilliz.com>
2025-12-30 10:07:21 +08:00
Buqian Zheng e379b1f0f4
enhance: moved query optimization to proxy, added various optimizations (#45526)
issue: https://github.com/milvus-io/milvus/issues/45525

see added README.md for added optimizations

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added query expression optimization feature with a new `optimizeExpr`
configuration flag to enable automatic simplification of filter
predicates, including range predicate optimization, merging of IN/NOT IN
conditions, and flattening of nested logical operators.

* **Bug Fixes**
* Adjusted delete operation behavior to correctly handle expression
evaluation.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
2025-12-24 00:39:19 +08:00
jiamingli-maker b9fe8e9f9e
test: add HNSW_SQ test cases (#46428)
/kind improvement
/assign @yanliang567

Signed-off-by: zilliz <jiaming.li@zilliz.com>
2025-12-22 11:29:18 +08:00
nico 51350f4ef8
test: optimize ci test about compaction and flush (#46097)
Signed-off-by: nico <cheng.yuan@zilliz.com>
2025-12-20 12:37:21 +08:00
zhuwenxing f9ff0e8402
test: add testcases for add/alter/drop text embedding function (#46229)
/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-12-09 19:23:14 +08:00
zhuwenxing abe0318bec
test: use predefined fake_de instead of creating new Faker instances to reduce run time (#46194)
related: https://github.com/milvus-io/milvus/issues/46014

/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-12-09 17:59:14 +08:00
nico 43fe215787
test: update sdk version and skip some debug log (#46040)
Signed-off-by: nico <cheng.yuan@zilliz.com>
2025-12-04 10:33:11 +08:00
Feilong Hou dd3797f3ac
test: add timestamptz to more bulk writer case (#46016)
Issue #46015
 <test>: <add timestamptz to more bulk writer>

 On branch feature/timestamps
 Changes to be committed:
	modified:   testcases/test_bulk_insert.py

Signed-off-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Eric Hou <eric.hou@zilliz.com>
2025-12-03 10:05:10 +08:00
yanliang567 13a52016ac
test: Update hybrid search tests with milvus client (#46003)
related issue: https://github.com/milvus-io/milvus/issues/45326

Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
2025-12-02 18:11:10 +08:00
jac 97da6bd7e3
test: Increase PyMilvus version to 2.7.0rc72 for master branch and fix async teardown logic (#45809)
Signed-off-by: silas.jiang <silas.jiang@zilliz.com>
Co-authored-by: silas.jiang <silas.jiang@zilliz.com>
2025-11-25 11:01:07 +08:00
yanliang567 1da75c0ee2
test: Update hybrid search tests to milvus client style (#45772)
related issue: #45326

---------

Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
2025-11-24 17:55:07 +08:00
Feilong Hou 228eb0f5d0
test: add more test cases and add bulk insert scenario (#45770)
Issue: #45756 
1. add bulk insert scenario
 2. fix small issue in e2e cases
 3. add search group by test case
 4. add timestampstz to gen_all_datatype_collection_schema
5. modify partial update testcase to ensure correct result from
timestamptz field

 On branch feature/timestamps
 Changes to be committed:
	modified:   common/bulk_insert_data.py
	modified:   common/common_func.py
	modified:   common/common_type.py
	modified:   milvus_client/test_milvus_client_partial_update.py
	modified:   milvus_client/test_milvus_client_timestamptz.py
	modified:   pytest.ini
	modified:   testcases/test_bulk_insert.py

Signed-off-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Eric Hou <eric.hou@zilliz.com>
2025-11-24 15:21:06 +08:00
wei liu 7aed88113c
enhance: Deduplicate primary keys in upsert request batch (#45249)
issue: #44320

This change adds deduplication logic to handle duplicate primary keys
within a single upsert batch, keeping the last occurrence of each
primary key.

Key changes:
- Add DeduplicateFieldData function to remove duplicate PKs from field
data, supporting both Int64 and VarChar primary keys
- Refactor fillFieldPropertiesBySchema into two separate functions:
validateFieldDataColumns for validation and fillFieldPropertiesOnly for
property filling, improving code clarity and reusability
- Integrate deduplication logic in upsertTask.PreExecute to
automatically deduplicate data before processing
- Add comprehensive unit tests for deduplication with various PK types
(Int64, VarChar) and field types (scalar, vector)
- Add Python integration tests to verify end-to-end behavior

---------

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
2025-11-17 21:35:40 +08:00
Spade A 0454cdaab3
fix: remove validateFieldName in dropIndex (#45460)
issue: https://github.com/milvus-io/milvus/issues/45459

This check is unnecessary when dropping index.

---------

Signed-off-by: SpadeA <tangchenjie1210@gmail.com>
2025-11-14 10:17:37 +08:00
Zhen Ye 4797bb6ab2
fix: wrong update timetick of collection meta info (#45461)
issue: #45403, #45463

- fix the Nightly E2E failures.
- fix the wrong update timetick of altering collection to fix the
related load failure.

Signed-off-by: chyezh <chyezh@outlook.com>
2025-11-11 16:01:36 +08:00
yanliang567 a2282d61cb
test: Add more async tests (#45327)
related issue: #45326

Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
2025-11-06 15:43:33 +08:00
zhuwenxing 06933c25b8
test: add geometry datatype in import testcases (#45014)
/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-11-04 16:55:33 +08:00
Zhen Ye 576084fe86
enhance: support alter collection/database with WAL-based DDL framework (#45266)
issue: #43897

- Alter collection/database is implemented by WAL-based DDL framework
now.
- Support AlterCollection/AlterDatabase in wal now.
- Alter operation can be synced by new CDC now.
- Refactor some UT for alter DDL.

---------

Signed-off-by: chyezh <chyezh@outlook.com>
2025-11-04 09:59:33 +08:00
nico a4935d2eaa
test: update rba test cases 2 (#44954)
Signed-off-by: nico <cheng.yuan@zilliz.com>
2025-10-20 16:32:03 +08:00