Files
qdrant/tests/e2e_tests/test_bugs.py
Andrey Vasnetsov c16c55b1fc Bump client timeout in flaky snapshots-consensus e2e test (#9808)
TestSnapshotsInterferenceWithConsensus flakes when the initial
create_collection exceeds the 10s client read timeout. Cluster logs
from a failing run show the primary stalling its consensus loop for
~5s while creating local shards on a loaded runner, which triggered
a leader election that delayed full shard activation to ~10.3s.

Setup operations now get a 30s client timeout. The regression check
for #7489 is unaffected: it relies on the server-side operation
timeout passed to delete_collection, not the client read timeout.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 21:14:04 +02:00

33 lines
1.6 KiB
Python

import pytest
from e2e_tests.client_utils import ClientUtils
class TestSnapshotsInterferenceWithConsensus:
@pytest.mark.parametrize("qdrant_compose", [
{"compose_file": "3-node-cluster.yaml"}
], indirect=True)
def test_snapshot_does_not_block_other_operations(self, qdrant_compose):
"""Test that creating snapshots does not block other operations - https://github.com/qdrant/qdrant/issues/7489."""
# Generous client-side timeout: setup operations can exceed 10s on loaded CI
# runners (e.g. a leader election triggered mid-create_collection). The actual
# regression check below relies on the server-side `timeout=5` passed to
# delete_collection, so it is not weakened by this.
client = ClientUtils(host=qdrant_compose[0].host, port=qdrant_compose[0].http_port, timeout=30)
client.wait_for_server()
assert client.wait_for_cluster_ready(expected_peers=3), "Cluster did not become ready within timeout"
# Create collection and insert points
collection_config = {"vectors": {"size": 512, "distance": "Dot"}, "shard_number": 3, "replication_factor": 1, "optimizers_config": {"indexing_threshold": 0}}
client.create_collection("test_collection", collection_config)
for points_batch in client.generate_points(1000, vector_size=512):
client.insert_points("test_collection", points_batch, wait=True)
client.create_collection("small", collection_config)
# Create snapshots very fast
for _ in range(50):
client.create_snapshot("test_collection", do_wait=False)
client.delete_collection("small", timeout=5)