Skip to content

Commit

Permalink
make test more leniant
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Oct 11, 2024
1 parent 24ea3f2 commit 931c566
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/integration/crud/client_bulk_write.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import {
clearFailPoint,
configureFailPoint,
makeMultiBatchWrite,
makeMultiResponseBatchModelArray
makeMultiResponseBatchModelArray,
waitUntilPoolsFilled
} from '../../tools/utils';
import { filterForCommands } from '../shared';

Expand Down Expand Up @@ -266,7 +267,7 @@ describe('Client Bulk Write', function () {
const commands: CommandStartedEvent[] = [];

beforeEach(async function () {
client = this.configuration.newClient({}, { monitorCommands: true });
client = this.configuration.newClient({}, { monitorCommands: true, minPoolSize: 5 });
client.on('commandStarted', filterForCommands(['getMore'], commands));
await client.connect();

Expand All @@ -291,7 +292,9 @@ describe('Client Bulk Write', function () {
expect(timeoutError).to.be.instanceOf(MongoOperationTimeoutError);

// DRIVERS-3005 - killCursors causes cursor cleanup to extend past timeoutMS.
expect(end - start).to.be.within(2000 - 100, 2000 + 100);
// The amount of time killCursors takes is wildly variable and can take up to almost
// 500ms sometimes.
expect(end - start).to.be.within(1500, 1500 + 600);
expect(commands).to.have.lengthOf(1);
});
});
Expand Down

0 comments on commit 931c566

Please sign in to comment.