@@ -132,10 +132,7 @@ def test_partial_snapshot_read_lock(tmp_path: pathlib.Path):
132132def 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
228227def bootstrap_read_peer (tmp : pathlib .Path , shards = 1 , recover_from_url : str | None = None ):
0 commit comments