( client: MongoClient, signal: AbortSignal, count: number = client.s.options.maxPoolSize )
| 412 | * serve as a way to ensure that some connections have been established and are in the pools. |
| 413 | */ |
| 414 | export async function waitUntilPoolsFilled( |
| 415 | client: MongoClient, |
| 416 | signal: AbortSignal, |
| 417 | count: number = client.s.options.maxPoolSize |
| 418 | ): Promise<void> { |
| 419 | let connectionCount = 0; |
| 420 | |
| 421 | async function wait$() { |
| 422 | for await (const _event of on(client, 'connectionCreated', { signal })) { |
| 423 | connectionCount++; |
| 424 | if (connectionCount >= count) { |
| 425 | break; |
| 426 | } |
| 427 | } |
| 428 | } |
| 429 | |
| 430 | await Promise.all([wait$(), client.connect()]); |
| 431 | } |
| 432 | |
| 433 | export async function configureFailPoint( |
| 434 | configuration: TestConfiguration, |
no test coverage detected