@@ -257,7 +257,7 @@ def _handle_placeholders(self, spec: dict, current: dict, path: str) -> Any:
257
257
current [key ] = self ._handle_placeholders (spec , value , subpath )
258
258
return current
259
259
260
- async def _create_entity (self , entity_spec , uri = None , init_client = False ):
260
+ async def _create_entity (self , entity_spec , uri = None ):
261
261
if len (entity_spec ) != 1 :
262
262
self .test .fail (f"Entity spec { entity_spec } did not contain exactly one top-level key" )
263
263
@@ -303,8 +303,7 @@ async def _create_entity(self, entity_spec, uri=None, init_client=False):
303
303
if uri :
304
304
kwargs ["h" ] = uri
305
305
client = await self .test .async_rs_or_single_client (** kwargs )
306
- if init_client :
307
- await client .aconnect ()
306
+ await client .aconnect ()
308
307
self [spec ["id" ]] = client
309
308
return
310
309
elif entity_type == "database" :
@@ -392,9 +391,9 @@ async def drop(self: AsyncGridFSBucket, *args: Any, **kwargs: Any) -> None:
392
391
393
392
self .test .fail (f"Unable to create entity of unknown type { entity_type } " )
394
393
395
- async def create_entities_from_spec (self , entity_spec , uri = None , init_client = False ):
394
+ async def create_entities_from_spec (self , entity_spec , uri = None ):
396
395
for spec in entity_spec :
397
- await self ._create_entity (spec , uri = uri , init_client = init_client )
396
+ await self ._create_entity (spec , uri = uri )
398
397
399
398
def get_listener_for_client (self , client_name : str ) -> EventListenerUtil :
400
399
client = self [client_name ]
@@ -1408,7 +1407,7 @@ async def run_scenario(self, spec, uri=None):
1408
1407
attempts = 3
1409
1408
for i in range (attempts ):
1410
1409
try :
1411
- return await self ._run_scenario (spec , uri , init_client = True )
1410
+ return await self ._run_scenario (spec , uri )
1412
1411
except (AssertionError , OperationFailure ) as exc :
1413
1412
if isinstance (exc , OperationFailure ) and (
1414
1413
_IS_SYNC or "failpoint" not in exc ._message
@@ -1428,7 +1427,7 @@ async def run_scenario(self, spec, uri=None):
1428
1427
await self ._run_scenario (spec , uri )
1429
1428
return None
1430
1429
1431
- async def _run_scenario (self , spec , uri = None , init_client = False ):
1430
+ async def _run_scenario (self , spec , uri = None ):
1432
1431
# maybe skip test manually
1433
1432
self .maybe_skip_test (spec )
1434
1433
@@ -1446,7 +1445,7 @@ async def _run_scenario(self, spec, uri=None, init_client=False):
1446
1445
self ._uri = uri
1447
1446
self .entity_map = EntityMapUtil (self )
1448
1447
await self .entity_map .create_entities_from_spec (
1449
- self .TEST_SPEC .get ("createEntities" , []), uri = uri , init_client = init_client
1448
+ self .TEST_SPEC .get ("createEntities" , []), uri = uri
1450
1449
)
1451
1450
self ._cluster_time = None
1452
1451
# process initialData
0 commit comments