Commit Graph

2218 Commits (17532517c611cafe5ec7a79bda47c9f296e82682)

Author SHA1 Message Date
yanliang567 17532517c6
test: Fix sparse/group_by/text_match/diskann/invalid/by_pk (#48347)
## Summary
- GPU→L1, zip() for positional index, add metric_type, fix spelling
- IVF_SQ8→DISKANN, skip DISKANN mmap, fix INT8 metric, filter assertions
- Fix false-pass bypass in check_search_results for empty hits

## Code Review Fix (0e4ad86c13)

### check_search_results: remove empty-hits bypass

`check_search_results` in `func_check.py` had a `if len(hits) == 0:
continue` guard that silently skipped all verification (including limit
check) when search returned no results. This caused tests with filters
matching zero rows to false-pass instead of failing.

Removed the 2-line guard entirely. The existing `assert len(hits) ==
check_items["limit"]` already handles this correctly — when limit is
specified and hits is empty, the assertion properly fails.

**Impact:** `test_search_with_scalar_field` in
`test_milvus_client_search_diskann.py` filters `int64 in [1, 2, 3, 4]`
on randomly-generated INT64 data (non-PK field uses full-range random
values). This matches 0 rows, and previously false-passed due to the
bypass. After the fix, it correctly fails. The filter in the test should
also be updated to use values that exist in the data.

Verified: ran all 6 PR test files (L0+L1, `-n 4`) — 88 passed, 1
expected failure (`test_search_with_scalar_field`), 9 skipped.

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

---------

Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 10:51:30 +08:00
yanliang567 61e929c2cf
test: Fix json/string/iterator/pagination verification (#48346)
## Summary
- Add check_task/filter assertions, fix hardcoded COSINE, add pk_range
to func_check
- Reduce L0 iterator combos, fix bare field names, increase
overlap_ratio

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

---------

Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 10:47:29 +08:00
yanliang567 cccd4b7259
test: Refactor search_array (1→7 tests) and e2e (23→loop) (#48344)
## Summary
- search_array: 1 test → 7 tests with Shared+Independent pattern
- e2e: 23 repetitive query blocks → data-driven loop (708→411 lines)

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

Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 10:45:28 +08:00
pymilvus-bot a18d125bcb
test: Increase PyMilvus version to 2.7.0rc162 for master branch (#48424)
Automated daily bump from pymilvus master branch. Updates
tests/python_client/requirements.txt.

Signed-off-by: pymilvus-bot <pymilvus@zilliz.com>
2026-03-24 09:49:32 +08:00
Li Yiyang d927b95a03
test: Add RBAC prefix isolation tests (#48381)
## Summary
- Add `TestMilvusClientRbacPrefixIsolation` class to
`test_milvus_client_rbac.py`
- Validates RBAC metadata integrity and permission isolation when
usernames/roles have prefix relationships (e.g. `user1` vs `user11`),
covering issue #47998 and PR #48053
- Single test method with setup/teardown per run, using random prefix
for test data isolation

## Related Issues
issue: #47998
pr: #48053

## Test Report
https://zilliverse.feishu.cn/docx/HaFld6sCyoMz19xOsC3cPCqdncg

## Test plan
- [x] Verified on v2.6.9 (pre-fix): FAIL on #03 DescribeUser
(empty-string role) and #23 ListDatabases
- [x] Verified on master-20260319 (post-fix): all PASS
- [x] Teardown cleans up all test data using `force_drop`, no residual
data

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

Signed-off-by: lyyyuna <yiyang.li@zilliz.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 11:27:29 +08:00
yanliang567 519719f7f8
test: Fix search_v2 series verification and add index constant (#48345)
## Summary
- Add `ct.all_dense_float_index_types` constant (replaces fragile `[:8]`
slices)
- Fix metric, duplicate keys, GPU→L1, IVF_FLAT→FLAT, spelling

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

Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 16:17:27 +08:00
yanliang567 78ca412942
test: Refactor search_load from 33 tests to parametrize-driven (#48343)
## Summary
Collapse 33 near-identical load/release/delete permutation tests into
parametrize-driven design (1479→612 lines, -59%).

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

---------

Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 16:13:27 +08:00
yanliang567 4467d61296
test: Fix hybrid_search critical bugs and verification gaps (#48342)
## Summary
- Fix `fitler` typo → `filter` (2 locations, filters were silently
ignored)
- Add `metric` and `enable_milvus_client_api` to 33 check_items
- Fix loop variable bug, remove stub test, single-value parametrize,
spelling

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

---------

Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 14:57:27 +08:00
zhuwenxing 96615cce41
test: add MinHash DIDO function test suite (#47324)
/kind improvement

add testcases and fix a related issue

issue: #47928

---------

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 17:17:30 +08:00
zhuwenxing df26144a3d
test: add struct array element search tests for phase 2 (#47688)
## Summary
- Add comprehensive test suite (~145 test methods) for struct array
element search
- Covers element_filter, MATCH_ALL/ANY/LEAST/MOST/EXACT, nested index,
non-float vectors, query, hybrid search, CRUD, iterator, and invalid
cases
- Bump pymilvus to 2.7.0rc138 for struct array fixes

/kind improvement

---------

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 17:15:27 +08:00
Feilong Hou ad54157295
test: add entity TTL upsert overwrite test and fix flaky TTL tests (#48271)
## Summary
- Add `test_upsert_overwrite_null_ttl_with_short_ttl` verifying that
upserting NULL TTL with a short TTL correctly expires data across
growing/sealed segments, release/reload, and compaction
- Remove skipped `test_alter_remove_entity_ttl_field` test (blocked by
#47416)
- Fix flaky TTL test cases by adding search retry logic — search and
query take different code paths and TTL filtering propagates at
different speeds, so search assertions need their own polling/retry

issue: #47482, #48260

Signed-off-by: FeilongHou <feilong.hou@zilliz.com>

## Test plan
- [x] New test case passes against a Milvus instance with entity TTL
support
- [x] CI passes

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

---------

Signed-off-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:37:32 +08:00
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
Feilong Hou 9a691f0745
test: preserve dynamic field and default value during partial update (#48217)
## Summary
- Fix partial update failing when dynamic field is enabled but no
dynamic data is provided during upsert
- Fix partial update failing when field has default value but is not
nullable
- Add E2E test cases covering dynamic field and default value scenarios
for partial update

issue: https://github.com/milvus-io/milvus/issues/47957,
https://github.com/milvus-io/milvus/issues/48002

## Test plan
- [x] Added E2E tests for partial update with dynamic fields
- [x] Added E2E tests for partial update with default value fields
- [x] Verified upsert works with empty dynamic field data
- [x] Verified upsert works with non-nullable fields that have default
values

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

---------

Signed-off-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 19:05:26 +08:00
yanliang567 6cc4d9a9d0
test: Remove hardcoded metric_type from chaos test search params (#48255)
## Summary
- Remove `metric_type` from `DEFAULT_SEARCH_PARAM` and
`DEFAULT_INT8_SEARCH_PARAM` in chaos test constants, letting the server
auto-infer metric type from the index
- Fixes chaos test failures (broken since build #24014) where
`AddVectorFieldChecker` creates COSINE-indexed vector fields but all
search checkers hardcode `metric_type: L2`

## Root Cause
In chaos tests, `AddVectorFieldChecker` dynamically adds nullable
FLOAT_VECTOR fields with **COSINE** HNSW index. After etcd pod-failure
recovery, `SearchChecker`, `HybridSearchChecker`, and
`NullVectorSearchChecker` re-initialize and discover these new fields.
When they search on them using hardcoded `metric_type: L2`, the server
returns:
- `metric type not match: invalid parameter[expected=COSINE][actual=L2]`
- `hybrid_search` 0% success rate (iterates ALL vector fields)
- `search`/`null_vector_search` ~28% success rate

Reference failure: [chaos-test-cron
#24056](https://qa-jenkins.milvus.io/blue/organizations/jenkins/chaos-test-cron/detail/chaos-test-cron/24056/pipeline/)

## Test plan
- [x] Verified on Milvus master (`master-20260313-f163e94`): search
without `metric_type` correctly auto-detects L2 and COSINE from index
- [x] Verified hybrid search across mixed metric types (L2 + COSINE)
works without specifying `metric_type`
- [x] Backwards compatible: explicit `metric_type` in search params
still works

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

Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 15:33:25 +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
zhuwenxing e6e2645991
test: set Strong consistency level for chaos test collections (#47931)
## Summary
- Set `consistency_level="Strong"` at collection creation time in chaos
`checker.py` (9 places) to ensure data correctness during chaos testing
- Add explicit `consistency_level="Strong"` to all search/query calls in
`test_all_collections_after_chaos.py` (8 places) since it operates on
pre-existing collections

## Test plan
- [x] Pod logs confirm `[consistency_level=Strong]` at CreateCollection
- [x] `describe_collection` returns `consistency_level: 0` (Strong)
- [x] Insert-then-query returns all data immediately without explicit
consistency_level param

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 17:11:24 +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
yanliang567 5fcb3334d1
test: Fix chaos checker dimension mismatch and vector field limit handling (#48105)
## Summary

Fix two bugs in chaos test checkers that cause
`test_concurrent_operation.py` to fail consistently (broken since build
#24014 in chaos-test-cron):

- **Op.hybrid_search 0% success rate**:
`HybridSearchChecker.gen_hybrid_search_request()` used a single cached
`self.dim` for all vector fields. When `AddVectorFieldChecker` adds
fields with different dimensions to the same collection, hybrid search
sends vectors with wrong dimensions, causing `vector dimension mismatch`
errors.
- **Op.add_vector_field 0% success rate**: Hardcoded `dim=32` created
dimension inconsistency with the collection schema (default `dim=128`).
The pre-check via `describe_collection` field counting was unreliable —
replaced with server-side error handling that catches `maximum vector
field` error and gracefully falls back to insert-only.

### Changes

**`tests/python_client/chaos/checker.py`:**
- `HybridSearchChecker.gen_hybrid_search_request()`: Query each vector
field's actual dimension from schema via `get_schema()` instead of using
a single cached dim
- `AddVectorFieldChecker.add_vector_field()`: Use `self.dim` instead of
hardcoded `dim=32`; catch server-side "maximum vector field" error and
fallback to insert

### Jenkins failure reference

https://qa-jenkins.milvus.io/blue/organizations/jenkins/chaos-test-cron/detail/chaos-test-cron/24056/pipeline

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

Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 17:13: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
Feilong Hou 2f8456c54d
test: add entity TTL chaos tests for upsert and insert during node kill (#48057)
## Summary
- Add chaos test for upsert-during-node-kill: verifies TTL extension via
upsert persists after querynode kill and WAL replay
- Add chaos test for insert-during-node-kill: verifies new data with TTL
inserted during chaos is correctly handled after recovery
- Fix `_verify_correctness` to distinguish "service never recovered"
from "wrong counts"
- Strengthen `_verify_search_consistency` to require non-zero valid
results from non-expired groups

## Test plan
- [x] All 5 chaos tests pass against a Milvus cluster with Chaos Mesh
- [x] Upsert test confirms TTL extension survives querynode kill
- [x] Insert test confirms both long-TTL (alive) and short-TTL (expired)
data inserted during chaos are correctly handled after recovery

issue: https://github.com/milvus-io/milvus/issues/47482

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

---------

Signed-off-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 20:51:24 +08:00
sparknack 6dc8418eac
enhance: add async warmup policy support for caching layer (#47627)
issue: #47902

Integrate milvus-common commit 7b54b6e which adds
CacheWarmupPolicy_Async and a prefetch thread pool for background cache
warmup. This enables segments to be marked as loaded immediately while
cache warming happens asynchronously, reducing load latency.

---------

Signed-off-by: Shawn Wang <shawn.wang@zilliz.com>
2026-03-10 14:45:23 +08:00
Feilong Hou be76bf709f
test: add entity TTL E2E test cases (#47948)
## Summary
- Add comprehensive E2E test cases for the Entity TTL feature (#47482)
- Cover collection creation/alter with `ttl_field`, insert with
future/expired/null TTL values, upsert to extend/shorten TTL, delete
before expiry, release/reload behavior, and query/search filtering of
expired data
- Add invalid parameter test cases: non-timestamptz field, nonexistent
field, nullable=false, and conflict with collection-level TTL
- Fix existing `test_milvus_client_ttl_edge` to properly assert error on
out-of-range TTL

## Test plan
- [x] All new test cases pass against a Milvus instance with entity TTL
support enabled
- [x] Existing TTL test cases remain passing

issue: #47482

---------

Signed-off-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:37:22 +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 4322a8cae1
test: Add null vector checkers to chaos test pipeline (#47979)
## Summary

Wire three null-vector checkers into the chaos test concurrent operation
pipeline (`test_concurrent_operation.py`):

- **NullVectorSearchChecker** — detects NaN distances from null vector
leaks in search index
- **NullVectorQueryChecker** — validates null/non-null ratio consistency
in queries
- **AddVectorFieldChecker** — dynamically adds nullable FLOAT_VECTOR
fields, creates index, inserts data, and verifies

These checkers are already implemented in `checker.py` but were not
registered in `init_health_checkers()`. The default collection schema
already has nullable vector fields (`float_vector` and `image_emb` both
`nullable=True`), so the checkers use the shared collection name.

issue: #47867

### Changes

**Modified:**
- `tests/python_client/chaos/testcases/test_concurrent_operation.py`:
Added imports and registered 3 checkers

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

Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 20:15:20 +08:00
Li Liu bac91805cd
test: fix 4 flaky tests across Go and Python (#47907)
## Summary
- **balancer_test**: use `defer b.Close()` immediately after creation in
`TestBalancer_WithRecoveryLag` to prevent goroutine leak causing DATA
RACE with next test's `resource.InitForTest()`
- **impl_test**: initialize `globalMetaCache` mock in
`TestProxyDropDatabase` to avoid nil pointer from stale global state
- **client_test**: replace `log.Fatalf` with `t.Fatalf` for listen
errors, silence `s.Serve()` return on `s.Stop()`, fix `lis.Addr()`
called before error check
- **test_milvus_client_ttl**: increase TTL from 5s to 20s with 2s margin
zones around TTL boundaries to ensure all assertion phases have
meaningful windows

## Test plan
- [ ] CI ut-go passes (covers fixes 1-3)
- [ ] CI e2e passes (covers fix 4)

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

---------

Signed-off-by: Li Liu <li.liu@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 19:03:20 +08:00
yanliang567 0748e46bed
test: Add scipy.sparse insert tests and hybrid search coverage for add_field (#47885)
## Summary

- Add E2E test coverage for **scipy.sparse** sparse vector input (insert
+ search)
- Add **hybrid search** step to existing add_vector_field test for issue
#47873 coverage

**Related issue**: #47884

### Changes

**test_milvus_client_insert.py** (+118 lines):
- `test_milvus_client_insert_sparse_vector_scipy` [L1]: direct CSR
format (`csr_matrix`, `csr_array`) insert + search
- `test_milvus_client_insert_sparse_vector_scipy_to_csr` [L2]: non-CSR
formats (`csc_matrix`, `coo_matrix`, `dok_matrix`, `lil_matrix`,
`coo_array`) converted via `.tocsr()` then insert + search

**test_add_field_feature.py** (+19 lines):
- Added hybrid search step (original + new nullable vector fields) to
existing `test_milvus_client_add_vector_field`
- Regression coverage for issue #47873 (HybridSearch on newly added
nullable vector fields after release+load)

### Test Plan

- [x] All 7 scipy.sparse format tests passed on standalone
(10.104.17.152), ~5s each
- [x] Hybrid search test passed on standalone (10.104.17.152) and
distributed (10.104.21.212)

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

Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
2026-02-28 10:57:23 +08:00
yanliang567 c047c20eaf
test: Add null vector coverage to chaos tests (#47868)
## Summary

Add nullable vector field validation to the chaos test framework via
three independent checkers, following the existing
one-operation-per-checker pattern.

**Related issue**: #47867

### Changes (v2, addressing review feedback)

**Removed** (per review):
- Reverted all modifications to existing `SearchChecker`,
`QueryChecker`, `AddFieldChecker`
- Removed `TestNullVectorDataPersistence` from
`test_data_persistence.py` — persistence verification is covered by
checkers

**New independent checkers (`chaos/checker.py`)**:

| Checker | Op Enum | Responsibility | Frequency |
|---|---|---|---|
| `NullVectorSearchChecker` | `null_vector_search` | Search on nullable
vector fields, NaN distance detection with accumulation threshold (3
consecutive) | `WAIT_PER_OP / 10` |
| `NullVectorQueryChecker` | `null_vector_query` | Query nullable vector
fields, validate null/non-null ratio, fail on all-null (data corruption)
| `WAIT_PER_OP / 10` |
| `AddVectorFieldChecker` | `add_vector_field` | Add nullable
FLOAT_VECTOR + HNSW index + insert + query verification, with vector
field limit guard | `WAIT_PER_OP * 6` |

**Review feedback addressed**:
- Each checker has independent stats and frequency (no sampling bias)
- NaN detection uses accumulation threshold (`NAN_THRESHOLD=3`) to avoid
false positives from transient errors or zero-norm vectors
- `AddVectorFieldChecker` checks vector field limit dynamically via
`describe_collection` (no hardcoded `MAX_FIELD_NUM`)
- Query results are properly validated (no `result = True` hardcode)

**pytest.ini**: disable locust plugin (`-p no:locust`) to fix `--host`
option conflict

### Test Plan

- [x] `checker.py` syntax verified
- [x] New checkers follow existing patterns (TensorSearchChecker,
JsonQueryChecker, GeoQueryChecker)
- [x] No modifications to existing checkers

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

Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
2026-02-28 10:33:23 +08:00
Li Liu c3713752da
enhance: remove unused Python test dependencies (#47854)
Related to #46199

## Summary
- Remove unused Python test dependencies: `ndg-httpsclient`,
`pyopenssl`, `pyasn1`, `pytest-parallel`, `timeout-decorator`
- Restore `pytest-assume==2.4.3` and `Unidecode==1.3.8` (actively used
in test code)
- Clean up dead `timeout_decorator` import and commented-out code in
`collection_wrapper.py`

## Performance impact

No production performance impact. All changes are in
`tests/python_client/` — test dependencies and test utility code only.
Milvus has no Python in its runtime (Go + C++ only).

| Change | Scope | Impact |
|--------|-------|--------|
| Remove 5 unused pip packages | Test `requirements.txt` | Faster test
env setup (~5 fewer packages to install) |
| Remove dead `timeout_decorator` import + commented-out code |
`collection_wrapper.py` | Cleaner test code, no behavior change |

## Test plan
- [ ] CI E2E tests pass (Python test suite runs successfully with
updated dependencies)

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

---------

Signed-off-by: Li Liu <li.liu@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 00:51:20 +08:00
zhuwenxing c5102683d3
enhance: increase default maxVectorFieldNum from 4 to 10 (#47866)
## Summary
- Increase the default `maxVectorFieldNum` from **4** to **10** to
accommodate the growing variety of vector types (dense, sparse,
function-based) supported by Milvus
- Update related test constants and hardcoded values in both Go and
Python test suites

## Changes
- `configs/milvus.yaml`: default config value 4 → 10
- `pkg/util/paramtable/component_param.go`: Go param default "4" → "10"
- `tests/go_client/common/consts.go`: Go test constant 4 → 10
- `tests/python_client/common/common_type.py`: Python test constant 4 →
10
- `tests/python_client/milvus_client/test_milvus_client_collection.py`:
replace hardcoded "4" in error message with constant reference

Closes #47402

## Test plan
- [x] Verify collection creation with up to 10 vector fields succeeds
- [x] Verify collection creation with 11+ vector fields fails with
proper error message
- [x] Run existing Go integration tests (`tests/go_client`)
- [x] Run existing Python client tests (`tests/python_client`)

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2026-02-26 14:18:47 +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 4bbc01324b
fix: handle NaN vs None comparison in output field value check for nullable fields (#47841)
## Summary

- Fix `output_field_value_check` in `param_check.py` to handle NaN vs
None comparison for nullable fields
- When nullable fields contain `None` values, `pandas.DataFrame`
converts them to `NaN`. The check function then fails comparing `NaN`
(from DataFrame) with `None` (from Milvus search results). This fix
treats both as equivalent null values.
- Remove resolved issue reference comments (`#47065`)

**Related issue**: #47065

### Changes

**Modified Files:**
- `tests/python_client/check/param_check.py`: Add NaN/None equivalence
check before asserting output field values
- `tests/python_client/milvus_client/test_add_field_feature.py`: Remove
resolved `#47065` comment
- `tests/python_client/milvus_client/test_milvus_client_collection.py`:
Remove resolved `#47065` comment

### Test Plan

- [x]
`test_search_by_pk_with_output_fields_and_consistency_level[Strong/Session/Bounded/Eventually]`
- 4 previously failing tests now PASS
- [x] All 98 search_by_pk tests: 93 passed + 4 fixed + 1 skipped
- [x] 13 null/nullable vector related tests all PASS

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

Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
2026-02-25 16:14:46 +08:00
zhuwenxing 8fc0b2d238
test: fix snapshot checker row count mismatch in chaos test (#47826)
## Summary
- Split snapshot testing into two checkers to fix row count mismatch
failures in chaos tests
- **SnapshotChecker** (`Op.snapshot`): lightweight, shares collection
with other checkers, only verifies snapshot create/restore operations
succeed
- **SnapshotRestoreChecker** (`Op.restore_snapshot`): uses independent
collection with internal DML operations, verifies data correctness (row
count + PK) after restore
- Removed `_snapshot_lock` from `Checker` class and all DML checkers
(Insert/Upsert/Delete) to eliminate coupling

## Root Cause
The `SnapshotRestoreChecker` shared a collection with other concurrent
checkers and relied on a global `_snapshot_lock` to prevent data
modifications during snapshot creation. However, some code paths (e.g.,
`Checker.insert_data()` base method,
`DeleteChecker.update_delete_expr()` refill logic) bypassed the lock,
causing row count mismatches after restore. The delta was exactly 3000
(`DELTA_PER_INS`).

Failure log: `expected=158188, actual=155188` (delta=3000)

ref:
https://qa-jenkins.milvus.io/blue/organizations/jenkins/chaos-test-cron/detail/chaos-test-cron/23943/pipeline

## Test plan
- [ ] Run chaos-test-cron pipeline and verify `Op.snapshot` (shared
collection) passes
- [ ] Verify `Op.restore_snapshot` (independent collection) passes with
no row count mismatch
- [ ] Confirm other checkers (insert/upsert/delete) are not impacted by
lock removal

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2026-02-25 15:58:47 +08:00
yanliang567 3a11ebcc88
test: Add comprehensive test coverage for nullable vector field functionality (#47847)
## Summary

Add 6 new test cases to `test_milvus_client_collection.py` covering gaps
in nullable vector field test coverage, identified after verifying fixes
for #47065 and #47197.

**Related issue**: #47846

### New Test Cases

| Test | Level | Coverage |
|------|-------|----------|
| `test_milvus_client_search_all_null_vectors` | L1 | Search on 100%
null vectors (sealed + growing) |
| `test_milvus_client_search_iterator_null_vector` | L1 | Search
iterator with all-null and mixed data |
| `test_milvus_client_query_iterator_null_vector` | L1 | Query iterator
returns all rows including null vectors |
| `test_milvus_client_upsert_null_vector_transitions` | L1 |
Non-null↔null transitions via upsert |
| `test_milvus_client_multi_vector_output_null` | L1 | Multi-vector
output with nullable field |
| `test_milvus_client_compact_with_null_vector` | L2 | Data integrity
after compaction with null vectors |

### Test Plan

- [x] All 6 tests passed against Milvus 2.6.6 (10.104.17.170)
- [x] No regressions in existing null vector tests

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

Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
2026-02-25 15:46:46 +08:00
Feilong Hou 8f282ef7fd
fix: partial update default update static field when fields name are the same (#47725)
## Summary
- After schema evolution (adding a static column that previously existed
as a dynamic field in `$meta`), partial update (`upsert` with
`partial_update=True`) fails with: `dynamic field name cannot include
the static field name`
- Root cause: during partial update, `queryPreExecute()` fetches
existing data where `$meta` still contains the old dynamic key. After
merging, `verifyDynamicFieldData()` rejects it because the key now
matches a static field name
- Fix: after the merge step in `queryPreExecute()`, strip any keys from
`$meta` JSON that conflict with current static field names

## Test plan
- [x] Added Go unit test
`TestUpsertTask_queryPreExecute_CleanUpMetaAfterSchemaEvolution`
- [x] Added Python e2e test
`test_milvus_client_partial_update_after_schema_evolution_dynamic_to_static`

issue: #47717

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

---------

Signed-off-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 17:46:46 +08:00
wt 447db2816d
test: add e2e tests for warmup feature at field/collection/index levels (#47764)
## Summary

Add 25 e2e test cases (38 with parametrization) for the warmup feature,
covering field/collection/index level warmup configuration and
cross-feature interactions.

### Test Coverage

- **Schema-level**: `add_field(warmup=sync/disable)` for all data types
- **Collection-level**: `warmup.scalarField / vectorField / scalarIndex
/ vectorIndex` properties
- **Index-level**: `alter_index_properties` warmup lifecycle
(set/update/drop)
- **Priority**: three-level priority (field/index > collection >
cluster), index overrides collection
- **Cross-feature**: warmup × mmap, partition, compaction,
multi-replica, growing segment, dynamic field, multi-vector fields
- **Negative cases**: invalid values, wrong-level keys
- **Idempotency & boundary**: create_index idempotent behavior,
drop/recreate residue check, empty collection, toggle repeatedly

### Changes

**Modified Files:**
- `tests/python_client/common/common_func.py`: Add 3 warmup helper
functions (`get_field_warmup`, `get_collection_warmup`,
`get_index_warmup`)
- `tests/python_client/milvus_client/test_milvus_client_alter.py`: Add
`TestMilvusClientWarmup` test class with 25 test methods

### Test Plan

- [x] All 38 tests passed locally with `-n 6` parallel execution (100s)
- [x] Tested against Milvus master branch with pymilvus 2.6.9

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

Signed-off-by: wangting0128 <ting.wang@zilliz.com>
2026-02-13 11:08:42 +08:00
Feilong Hou dc8a22049e
test: add e2e test case for search order by (#47616)
Issue: #47548

 On branch feature/search-order
 Changes to be committed:
	new file:   milvus_client/test_milvus_client_search_order.py

---------

Signed-off-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 17:22:42 +08:00
pymilvus-bot f20f9066d8
test: Increase PyMilvus version to 2.7.0rc141 for master branch (#47714)
Automated daily bump from pymilvus master branch. Updates
tests/python_client/requirements.txt.

Signed-off-by: pymilvus-bot <pymilvus@zilliz.com>
2026-02-10 19:12:42 +08:00
congqixia 1bd65fc1ce
enhance: remove deprecated lazy load code (#47590)
Related to #44452

Remove the deprecated lazy load feature which has been superseded by
warmup-related parameters. This cleanup includes:

- Remove AddFieldDataInfoForSealed from C++ segcore layer
- Remove IsLazyLoad() method and isLazyLoad field from segment
- Remove lazy load checks in proxy alterCollectionTask
- Remove DiskCache lazy load handling in search/retrieve paths
- Remove LazyLoadEnableKey constant and related helper functions
- Update mock files to reflect interface changes

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2026-02-10 14:14:44 +08:00
Feilong Hou 6c7373c34d
test: restructure timestamptz e2e cases with shared collection (#47670)
## Summary
- Restructure `TestMilvusClientTimestamptz` to use a shared collection
with non-overlapping PK ranges, reducing test setup overhead
- Add query verification to `test_partial_update` to assert timestamps
are correctly updated
- Separate test data into isolated PK slots to prevent cross-test
interference

Issue: #47668

## Test plan
- [x] Run timestamptz e2e tests to verify all cases pass
- [x] Verify partial update test now properly asserts query results

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

Signed-off-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 18:55:52 +08:00
wei liu 7045db3c75
fix: make snapshot creation idempotent to prevent callback retry loop [DataCoord] (#47580)
## Summary

Move snapshot existence checks to occur after acquiring exclusive locks
in CreateSnapshot and DropSnapshot. This ensures that when multiple
concurrent requests attempt to create snapshots with the same name, only
one succeeds and others immediately fail with "already exists" error,
allowing DDL callbacks to handle the result properly without entering
infinite retry loops.

## Related Issue

issue: #47101

## Changes

- **CreateSnapshot**: Move snapshot name existence check to after lock
acquisition
- **DropSnapshot**: Move snapshot existence check to after lock
acquisition
- **Test**: Fix concurrent snapshot creation test to verify "already
exists" errors by directly calling client methods to bypass
ResponseChecker framework masking

## Test Plan

-  Unit test: `test_snapshot_concurrent_create_same_name` passes
consistently
-  Verified concurrent behavior: 1 success + 4 "already exists" errors
-  No race conditions observed across multiple test runs

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

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
2026-02-09 18:51:52 +08:00
wt cd509c8bf2
fix: add WarmupKey to checkParams filter for CreateIndex idempotency (#47595)
issue: https://github.com/milvus-io/milvus/pull/39803

When creating an index, WarmupKey is removed from TypeParams before
storage (in index_service.go). However, checkParams function was not
filtering WarmupKey when comparing TypeParams for idempotency check,
causing the second CreateIndex call to fail with "at most one distinct
index is allowed per field" error.

This fix adds WarmupKey to the DeleteParams filter in checkParams
function, ensuring consistent behavior with index creation and proper
idempotency.

Signed-off-by: wangting0128 <ting.wang@zilliz.com>
2026-02-06 11:09:50 +08:00
yanliang567 88cd109afc
test: add e2e tests for three-valued logic with nullable fields (#47582)
## Summary
Add comprehensive e2e test cases for PR #47333 which fixed three-valued
logic issues in expression evaluation with NULL values.

### Test Coverage (19 cases)

**TestMilvusClientThreeValuedLogic (17 tests)**
- **Basic IS NULL / IS NOT NULL** (2 tests)
- **NOT operator equivalences** - `NOT (IS NOT NULL) == IS NULL` (2
tests)
- **Multiple NOT operations** - double/triple NOT (2 tests)
- **Multi-field NULL combinations** - AND/OR with two nullable fields (2
tests)
- **De Morgan's law** - `NOT (A AND B)`, `NOT (A OR B)` (2 tests)
- **NULL with value comparisons** - combined NULL check and value filter
(3 tests)
- **Mixed filters** - id filter + NULL check (2 tests)
- **Search API** - search with NULL filter expressions (2 tests)

**TestMilvusClientThreeValuedLogicIssue46972 (2 tests)**
- Complex JSON expressions that triggered "False OR False = True" bug
- Uses exact reproduction case from issue #46972

### Test Design
- Uses shared collection pattern for efficiency
- Expected values calculated dynamically from stored data (not
hardcoded)
- Easy to extend with new test cases

### Verification
| Server | Result |
|--------|--------|
| With fix (master) | **19 passed** |
| Without fix (pre-PR#47333) | Multiple failures reproducing the bug |

issue: #46820, #46972

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

---------

Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 10:55:51 +08:00
yanliang567 7b78c09e98
enhance: distinguish xfail and xpass in test report plugin (#47588)
## Summary

This PR enhances the Python test log filter plugin to properly
distinguish between xfail and xpass test outcomes, which were previously
not categorized separately.

- **xfail**: Tests marked with `@pytest.mark.xfail` that failed as
expected
- **xpass**: Tests marked with `@pytest.mark.xfail` that passed
unexpectedly (needs attention)

Related to #47253

## Changes

- Detect xfail/xpass using pytest's `wasxfail` attribute
- Add `xfail` and `xpass` categories to `test_stats` tracking
- Update JSON report with xfail/xpass in summary and tests sections
- Update HTML report with:
  - New summary cards for xfail (purple) and xpass (pink)
- XPass section with full logs (since unexpected passes need
investigation)
  - XFail section with reason only (expected behavior, just tracking)
- Support parallel test runs with worker data merging for xfail/xpass

## Test plan

- [x] Python syntax validation passes
- [ ] Run tests with xfail markers to verify correct categorization
- [ ] Verify JSON report contains xfail/xpass sections
- [ ] Verify HTML report displays xfail/xpass with correct styling

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

Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 20:17:51 +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 1257a9db1d
test: remove xfail markers for issues fixed in PR #47096 (#47555)
## Summary

Remove xfail markers for snapshot tests that are now passing after PR
#47096 fix.

Related PR: https://github.com/milvus-io/milvus/pull/47096

### Fixed Issues
- #47066: `list_snapshots()` now correctly handles empty
`collection_name` parameter
- #47067: `get_restore_snapshot_state()` now correctly returns
`start_time`
- #47068: `create_snapshot`/`drop_snapshot` now validates
`snapshot_name` properly

### Test Cases Updated
| Issue | Test Case | Change |
|-------|-----------|--------|
| #47066 | `test_snapshot_list_after_drop_collection` | Removed xfail |
| #47067 | `test_snapshot_restore_progress_tracking` | Removed xfail |
| #47068 | `test_snapshot_create_whitespace_name` | Removed xfail,
updated error code/message |
| #47068 | `test_snapshot_drop_whitespace_name` | Removed xfail, updated
error code/message |

## Test Plan

- [x] All 4 tests pass against master branch (commit f36ed550)
- [x] Verified with Milvus instance: `master-20260204-f36ed550-amd64`

```
milvus_client/test_milvus_client_snapshot.py::TestMilvusClientSnapshotCreateInvalid::test_snapshot_create_whitespace_name PASSED
milvus_client/test_milvus_client_snapshot.py::TestMilvusClientSnapshotDropInvalid::test_snapshot_drop_whitespace_name PASSED
milvus_client/test_milvus_client_snapshot.py::TestMilvusClientSnapshotBoundary::test_snapshot_restore_progress_tracking PASSED
milvus_client/test_milvus_client_snapshot.py::TestMilvusClientSnapshotNegative::test_snapshot_list_after_drop_collection PASSED
```

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2026-02-05 12:51:50 +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
zhuwenxing c7bacaf325
test: add SnapshotRestoreChecker for chaos testing (#47418)
## Summary
- Add `SnapshotRestoreChecker` to test snapshot restore functionality in
chaos testing
- Support concurrent execution with other checkers (shared collection)
- Use `self.get_schema()` to get latest schema for DML operations
- Simplified data verification for concurrent scenarios

## Test plan
- [x] Single run test passed
- [x] Concurrent operation test passed (100% success rate)
- [x] Added to test_concurrent_operation.py
- [x] Added to test_single_request_operation.py

---------

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2026-02-03 15:34:24 +08:00
zhuwenxing a80e003731
test: add snapshot API test cases (#47309)
## Summary
- Add comprehensive test cases for Milvus snapshot API functionality
- Cover snapshot create, list, describe, drop, restore operations
- Test various data types, index types, partition scenarios
- Add concurrent operation and data integrity tests
- Update pymilvus to 2.7.0rc122 for snapshot API support

## Test Coverage
- L0 smoke tests: basic snapshot lifecycle
- L1 tests: data types, partitions, indexes
- L2 tests: boundary conditions, negative cases, concurrency

## Related Issue
https://github.com/milvus-io/milvus/issues/44358

## Test plan
- [x] Run tests with `-n 6` parallel execution
- [x] Verify all tests pass (67 tests: 62 passed, 4 xfail)

---------

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2026-01-28 19:41:33 +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
yanliang567 bdb56f6053
enhance: Optimize Python test logging from 60MB to 3-5MB per run (#47253)
## Summary

This PR optimizes Python test logging to reduce log file size from 60MB+
to 3-5MB per test run (90%+ reduction) while preserving full debugging
information for failed tests.

related issue:  #47256

### Key Improvements

- **Conditional Logging**: PASSED tests save only metadata, FAILED tests
preserve complete logs
- **Memory Buffering**: Eliminates runtime disk I/O (no file writes
during test execution)
- **Unified Reports**: Generates 2 formats
  - `test_report.json`: AI-friendly structured data
  - `test_report.html`: Human-readable with color-coded logs
- **Worker Parallelism**: Full support for `pytest -n` with data merging

### Performance Impact

| Metric | Before | After | Improvement |
|--------|--------|-------|-------------|
| **Log Size** (15K tests) | 60 MB | 3-5 MB | **-90%+** |
| **Memory Usage** (6 workers) | ~50 MB | ~450 MB | +400 MB |
| **CPU Overhead** | N/A | 0.0004% | Negligible |
| **Runtime I/O** | 75 seconds | 75 ms | **-99.9%** |

### Changes

**New Files:**
- `plugin/log_filter.py`: Conditional log handler with per-test memory
buffers
- `plugin/__init__.py`: Plugin package initialization

**Modified Files:**
- `config/log_config.py`: Simplified config (only JSON/HTML paths)
- `conftest.py`: Register log filter plugin
- `utils/util_log.py`: Removed redundant file handlers
- `utils/api_request.py`: Optimized API request logging
- `check/param_check.py`: Truncate long lists in error messages
- `common/common_func.py`: Removed verbose logging
- `pytest.ini`: Added log filter plugin

**Cleanup:**
- `milvus_client/test_add_field_feature.py`: Removed unused variable

### Test Plan

- [x] Syntax validation: All Python files pass `py_compile`
- [x] Module imports: All modules load successfully
- [x] Data structures: Verified serialization without report/buffer
objects
- [x] Log configuration: Confirmed only necessary attributes present
- [x] Small-scale test (17 tests):  Generated correct JSON + HTML
reports
- [x] Performance analysis: Memory/CPU profiling for 15K test scenario

### Example Output

**test_report.html** (human-readable):
- Beautiful color-coded UI
- Failed tests with full error traceback
- Expandable log sections by level (debug/info/warning/error)

**test_report.json** (AI-friendly):
```json
{
  "metadata": { "total_tests": 15000, ... },
  "summary": { "passed": 13500, "failed": 1500, ... },
  "tests": {
    "failed": [
      {
        "id": "test.py::test_func",
        "error": { "type": "AssertionError", ... },
        "logs": { "debug": [...], "error": [...] }
      }
    ]
  }
}
```

### Memory Safety

For the standard scenario (15K tests, 10% failure, 6 workers):
- Worker memory: ~53 MB each (318 MB total)
- Main process peak: ~112 MB
- Total system: **< 450 MB**  Safe

High-risk scenarios (>30% failure or >50K tests) may require optional
streaming optimizations (documented in performance analysis).

### Backward Compatibility

-  No breaking changes to external APIs
-  Existing test commands work unchanged
-  Compatible with all pytest plugins

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

Signed-off-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
2026-01-27 16:37:33 +08:00