diff --git a/test/integration/crud/client_bulk_write.test.ts b/test/integration/crud/client_bulk_write.test.ts index fa20d8ed29a..0d1ce58029c 100644 --- a/test/integration/crud/client_bulk_write.test.ts +++ b/test/integration/crud/client_bulk_write.test.ts @@ -289,12 +289,13 @@ describe('Client Bulk Write', function () { } }), async function () { + const timeoutMS = 1500; const models = await makeMultiResponseBatchModelArray(this.configuration); const start = now(); const timeoutError = await client .bulkWrite(models, { verboseResults: true, - timeoutMS: 1500 + timeoutMS }) .catch(e => e); @@ -304,7 +305,7 @@ describe('Client Bulk Write', function () { // DRIVERS-3005 - killCursors causes cursor cleanup to extend past timeoutMS. // The amount of time killCursors takes is wildly variable and can take up to almost // 600-700ms sometimes. - expect(end - start).to.be.within(1500, 1500 + 800); + expect(end - start).to.be.within(timeoutMS - 100, timeoutMS + 800); expect(commands.map(({ commandName }) => commandName)).to.have.lengthOf(2); } );