test: relax limit assertion for HNSW_SQ params48 (M=2,efConstruction=1) to fix flaky test (#48788)

## Summary

- Add `relaxed_limit: True` marker to params48 (`M=2, efConstruction=1,
sq_type=SQ6`) in `idx_hnsw_sq.py`
- Update `test_hnsw_sq_build_params` to only assert `> 0` results for
relaxed-limit cases, keeping strict `topK` assertion for all other
combinations

## Root Cause

With `M=2` and `efConstruction=1`, the HNSW graph has extremely poor
connectivity. Depending on random data distribution across concurrent
workers, the graph may have disconnected components — making it
impossible to traverse enough neighbors to fill `topK=10`. This causes
`AssertionError` intermittently under 6-way concurrency.

This is **expected HNSW behavior** for extreme boundary parameters, not
a Milvus server bug.

**Reproduction rate**: ~33% failure under `-n 6` concurrent load (4/12
runs failed before fix, 0/12 after).

issue: #48762

## Test plan

- [x] Reproduced failure: 4/12 runs failed with `-n 6 --count 12` before
fix
- [x] Verified fix: 12/12 passed after fix
- [x] All other `test_hnsw_sq_build_params` parametrizations unaffected
(strict limit assertion unchanged)

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

Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
yanliang567
2026-04-08 09:36:33 +08:00
committed by GitHub
co-authored by Claude Sonnet 4.6
parent 1726640c5c
commit 07930ff01a

Diff Content Not Available