Skip to content

Fix flaky strict mode collection size tests - #8922

Merged
agourlay merged 1 commit into
devfrom
fix/flaky-strict-mode-size-tests
May 6, 2026
Merged

agourlay merged 1 commit into
devfrom
fix/flaky-strict-mode-size-tests

Conversation

@qdrant-cloud-bot

Copy link
Copy Markdown
Contributor

Summary

  • Fix flaky test_strict_mode_max_collection_size_upsert_batch and similar tests by adding wait=true to upsert operations

Root Cause

These tests validate that strict mode's collection size limits are enforced. They work by:

  1. Upserting points to fill the collection near the limit
  2. Expecting that subsequent upserts will be rejected once the cached size stats refresh (every 32 calls)

Without wait=true, upsert operations are written to WAL and acknowledged immediately, but not yet applied to segments. When the size stats cache refreshes, it reads the current segment state — which may not reflect pending WAL operations. Under CI load, the async write worker may lag, causing all 32 retry iterations to see stale (below-limit) sizes and the test fails.

Fix

Add query_params={'wait': 'true'} to the upsert helper functions in all 4 affected tests:

  • test_strict_mode_max_collection_size_upsert
  • test_strict_mode_max_collection_size_upsert_batch
  • test_strict_mode_max_collection_payload_size_upsert_batch
  • test_strict_mode_max_collection_point_count_upsert_batch

This ensures operations are applied to segments before the response returns, so the cache refresh sees correct sizes.

Test plan

Made with Cursor

These tests rely on the collection size stats cache being refreshed to
detect that a size limit has been exceeded. Without wait=true, upsert
operations are written to WAL and acknowledged immediately without being
applied to segments. When the cache refreshes, it reads segment data
which may not yet reflect the pending WAL operations, causing the size
check to see stale values and not reject the request.

Adding wait=true ensures operations are applied to segments before the
response returns, so the cache refresh sees the correct sizes.

Co-authored-by: Cursor <[email protected]>
coderabbitai[bot]

This comment was marked as resolved.

@agourlay
agourlay merged commit be82ece into dev May 6, 2026
15 checks passed
@agourlay
agourlay deleted the fix/flaky-strict-mode-size-tests branch May 6, 2026 11:14
@qdrant qdrant deleted a comment from coderabbitai Bot May 6, 2026
timvisee pushed a commit that referenced this pull request May 8, 2026
These tests rely on the collection size stats cache being refreshed to
detect that a size limit has been exceeded. Without wait=true, upsert
operations are written to WAL and acknowledged immediately without being
applied to segments. When the cache refreshes, it reads segment data
which may not yet reflect the pending WAL operations, causing the size
check to see stale values and not reject the request.

Adding wait=true ensures operations are applied to segments before the
response returns, so the cache refresh sees the correct sizes.

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Cursor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants