From 5bcc42007398291a8b9141ac6fe6bd7b3a13c7d7 Mon Sep 17 00:00:00 2001 From: qdrant-cloud-bot <111755117+qdrant-cloud-bot@users.noreply.github.com> Date: Wed, 17 Jun 2026 10:23:45 +0200 Subject: [PATCH] test: fix flaky test_partial_snapshot_empty (#9493) The test asserts that creating a partial snapshot between two in-sync peers returns 304 (empty diff). It only waited for the write peer to become green, but read the read peer's manifest for the comparison. An async optimization reshaping the read peer's segments after collection-snapshot recovery makes its manifest diverge from the write peer's files, producing 200 instead of 304 (assert 200 == 304). Wait for the read peer to become green as well before comparing manifests, mirroring the earlier flaky-test fixes (#7358, #7360). Co-authored-by: Cursor --- tests/consensus_tests/test_partial_snapshot.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/consensus_tests/test_partial_snapshot.py b/tests/consensus_tests/test_partial_snapshot.py index 6fe7155b05..e7733c06c6 100644 --- a/tests/consensus_tests/test_partial_snapshot.py +++ b/tests/consensus_tests/test_partial_snapshot.py @@ -134,6 +134,11 @@ def test_partial_snapshot_empty(tmp_path: pathlib.Path): write_peer, read_peer = bootstrap_peers(tmp_path, bootstrap_points = 1000, recover_read= True, wait_for_green = True) + # Wait for the read peer to settle too: an async optimization reshaping its + # segments after recovery would make its manifest diverge from the write + # peer's files, turning the expected empty (304) partial snapshot into a 200. + wait_collection_green(read_peer, COLLECTION) + # Collection snapshot doesn't affect partial snapshot recovery timestamp recovery_ts = get_telemetry_collections(read_peer)[0]['shards'][0]['partial_snapshot']['recovery_timestamp'] assert recovery_ts == 0