@@ -324,22 +324,6 @@ export class EntitiesMap<E = Entity> extends Map<string, E> {
324
324
await session . endSession ( { force : true } ) ;
325
325
}
326
326
327
- trace ( 'drop namespaces' ) ;
328
- for ( const [ , db ] of this . mapOf ( 'db' ) ) {
329
- if ( [ 'admin' , 'local' , 'config' ] . includes ( db . databaseName ) ) {
330
- continue ;
331
- }
332
- expect ( await db . dropDatabase ( ) ) . to . be . true ;
333
- }
334
-
335
- trace ( 'drop namespaces' ) ;
336
- for ( const [ , db ] of this . mapOf ( 'db' ) ) {
337
- if ( [ 'admin' , 'local' , 'config' ] . includes ( db . databaseName ) ) {
338
- continue ;
339
- }
340
- expect ( await db . dropDatabase ( ) ) . to . be . true ;
341
- }
342
-
343
327
trace ( 'closeClient' ) ;
344
328
for ( const [ , client ] of this . mapOf ( 'client' ) ) {
345
329
await client . close ( ) ;
@@ -380,20 +364,10 @@ export class EntitiesMap<E = Entity> extends Map<string, E> {
380
364
map . set ( entity . database . id , db ) ;
381
365
} else if ( 'collection' in entity ) {
382
366
const db = map . getEntity ( 'db' , entity . collection . database ) ;
383
- const collection = await db
384
- . createCollection (
385
- entity . collection . collectionName ,
386
- patchCollectionOptions ( entity . collection . collectionOptions )
387
- )
388
- . catch ( error => {
389
- if ( / a l r e a d y e x i s t s / . test ( error . message ) ) {
390
- return db . collection (
391
- entity . collection . collectionName ,
392
- patchCollectionOptions ( entity . collection . collectionOptions )
393
- ) ;
394
- }
395
- throw error ;
396
- } ) ;
367
+ const collection = db . collection (
368
+ entity . collection . collectionName ,
369
+ patchCollectionOptions ( entity . collection . collectionOptions )
370
+ ) ;
397
371
map . set ( entity . collection . id , collection ) ;
398
372
} else if ( 'session' in entity ) {
399
373
const client = map . getEntity ( 'client' , entity . session . client ) ;
@@ -453,13 +427,6 @@ export class EntitiesMap<E = Entity> extends Map<string, E> {
453
427
throw new Error ( `Unsupported Entity ${ JSON . stringify ( entity ) } ` ) ;
454
428
}
455
429
}
456
-
457
- // startup events are never part of testing
458
- for ( const [ , client ] of map . mapOf ( 'client' ) ) {
459
- client . commandEvents = [ ] ;
460
- // client.cmapEvents = []; TODO connect optional PR
461
- }
462
-
463
430
return map ;
464
431
}
465
432
}
0 commit comments