Commit 2a156bb
committed
test(search): add metadata-filter poll_until to fix flaky filter tests
## Purpose
CI-0058: `test_search_with_filter_rest` failed with `assert 0 > 0` because
the test only waited for vector indexing (unfiltered search returns >= 3 hits)
but did not wait for the backend's metadata filter index to be ready. Vector
indexing and metadata filter indexing are separate backend processes with
different propagation latencies.
## Solution
- Added a second `poll_until` in `test_search_with_filter_rest` and
`test_search_with_filter_grpc` that specifically waits for the filtered
search to return results before asserting. This converts a cryptic
`AssertionError` into a clear `TimeoutError` if the backend never indexes
metadata, and eliminates the race for the normal timing-dependent case.
- Added `test_upsert_records_preserves_metadata_fields` to confirm at the
SDK level that non-`field_map` fields (e.g. `category`) are forwarded in
the NDJSON payload — ruling out SDK-side metadata stripping as a root cause.
Code analysis ruled out the two other hypotheses:
- H1 (SDK strips non-field_map fields): `upsert_records` shallow-copies all
fields and serializes them verbatim to NDJSON. New unit test confirms this.
- H2 (filter dropped from search request): `Index.search` puts `filter` in
`body["query"]["filter"]` per the API spec. Existing unit test confirms this.
Fixes CI-0058.1 parent 3761bc8 commit 2a156bb
2 files changed
Lines changed: 62 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
| 399 | + | |
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
411 | | - | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
412 | 428 | | |
413 | 429 | | |
414 | 430 | | |
| |||
504 | 520 | | |
505 | 521 | | |
506 | 522 | | |
507 | | - | |
| 523 | + | |
508 | 524 | | |
509 | 525 | | |
510 | 526 | | |
| |||
516 | 532 | | |
517 | 533 | | |
518 | 534 | | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
519 | 548 | | |
520 | 549 | | |
521 | 550 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
172 | 202 | | |
173 | 203 | | |
174 | 204 | | |
| |||
0 commit comments