Commit Graph

16 Commits (17532517c611cafe5ec7a79bda47c9f296e82682)

Author SHA1 Message Date
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
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
zhuwenxing 464a805c63
test: add dynamicfield.enabled property alter in chaos checker (#45625)
/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-11-27 14:53:08 +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
zhikunyao aa0870d2ff
test: add e2e-v2 helm for amd (#45621)
Signed-off-by: Zhikun Yao <zhikun.yao@zilliz.com>
2025-11-20 13:45:11 +08:00
zhuwenxing e0df44481d
test: refactor checker to using milvus client (#45524)
/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-11-20 11:59:08 +08:00
zhuwenxing 7b26cef3be
test: add group by for fts hybrid search (#43037)
/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-07-02 11:16:50 +08:00
ThreadDao ea339c13c6
test: add cases for async milvus client (#38699)
issue: #38697

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2024-12-25 16:54:50 +08:00
zhuwenxing ca1f7ab019
test: update import test case to support different dim (#33709)
add test case for https://github.com/milvus-io/milvus/issues/33681

---------

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2024-06-13 17:11:55 +08:00
zhuwenxing 4ec7cbcae7
test: remove some local config (#33567)
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2024-06-05 11:27:50 +08:00
zhuwenxing 3336b91ce6
test: add channel exclusive balance test and resource group test (#33093)
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2024-05-31 13:55:52 +08:00
zhuwenxing fe515afc6e
[skip ci] Delete the config of report portal (#9089)
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2021-10-02 21:30:04 +08:00
ThreadDao b9f14dc321
[skip ci] Remove unnecessary pytest.ini comment (#8981)
Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2021-09-30 19:04:21 +08:00
binbin 068cc14313
Merge collection test cases from pymilvus and orm (#7414)
Signed-off-by: Binbin Lv <binbin.lv@zilliz.com>
2021-09-01 19:43:59 +08:00
zhuwenxing 1bd83479aa
Integrate reportportal into nightly CI (#7246)
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2021-08-25 15:11:52 +08:00
binbin eff75c7701
Replace sdk source and merge tests and tests20 (#7182)
Signed-off-by: Binbin Lv <binbin.lv@zilliz.com>
2021-08-20 11:00:56 +08:00