Skip to content

Commit 94bdb4a

Browse files
committed
fix test_partial_snapshot_empty
1 parent 842abe0 commit 94bdb4a

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

tests/consensus_tests/test_partial_snapshot.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,7 @@ def test_partial_snapshot_read_lock(tmp_path: pathlib.Path):
132132
def test_partial_snapshot_empty(tmp_path: pathlib.Path):
133133
assert_project_root()
134134

135-
write_peer, read_peer = bootstrap_peers(tmp_path, bootstrap_points = 1000, recover_read= True)
136-
137-
# Don't let asynchronous optimizations mess with our test
138-
wait_collection_green(write_peer, COLLECTION)
135+
write_peer, read_peer = bootstrap_peers(tmp_path, bootstrap_points = 1000, recover_read= True, wait_for_green = True)
139136

140137
# Collection snapshot doesn't affect partial snapshot recovery timestamp
141138
recovery_ts = get_telemetry_collections(read_peer)[0]['shards'][0]['partial_snapshot']['recovery_timestamp']
@@ -215,14 +212,16 @@ def test_partial_snapshot_recreate_payload_field_index(tmp_path: pathlib.Path):
215212
assert_http_ok(resp)
216213

217214

218-
def bootstrap_peers(tmp: pathlib.Path, shards = 1, bootstrap_points = 0, recover_read = False):
219-
write_peer = bootstrap_write_peer(tmp, shards, bootstrap_points)
215+
def bootstrap_peers(tmp: pathlib.Path, shards = 1, bootstrap_points = 0, recover_read = False, wait_for_green = False):
216+
write_peer = bootstrap_write_peer(tmp, shards, bootstrap_points, wait_for_green=wait_for_green)
220217
read_peer = bootstrap_read_peer(tmp, shards, write_peer if recover_read else None)
221218
return write_peer, read_peer
222219

223-
def bootstrap_write_peer(tmp: pathlib.Path, shards = 1, bootstrap_points = 0):
220+
def bootstrap_write_peer(tmp: pathlib.Path, shards = 1, bootstrap_points = 0, wait_for_green = False):
224221
write_peer = bootstrap_peer(tmp / "write", 6331, "write_")
225222
bootstrap_collection(write_peer, shards, bootstrap_points)
223+
if wait_for_green:
224+
wait_collection_green(write_peer, collection_name=COLLECTION)
226225
return write_peer
227226

228227
def bootstrap_read_peer(tmp: pathlib.Path, shards = 1, recover_from_url: str | None = None):

0 commit comments

Comments
 (0)