Skip to content

Commit 9ff52ec

Browse files
authored
test(NODE-6848): reduce flakiness of Client Bulk Write CSOT enabled acknowledged writes when the timeout is reached while iterating the result cursor the bulk write operation times out (#4459)
1 parent 1f5b716 commit 9ff52ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/integration/crud/client_bulk_write.test.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,13 @@ describe('Client Bulk Write', function () {
289289
}
290290
}),
291291
async function () {
292+
const timeoutMS = 1500;
292293
const models = await makeMultiResponseBatchModelArray(this.configuration);
293294
const start = now();
294295
const timeoutError = await client
295296
.bulkWrite(models, {
296297
verboseResults: true,
297-
timeoutMS: 1500
298+
timeoutMS
298299
})
299300
.catch(e => e);
300301

@@ -304,7 +305,7 @@ describe('Client Bulk Write', function () {
304305
// DRIVERS-3005 - killCursors causes cursor cleanup to extend past timeoutMS.
305306
// The amount of time killCursors takes is wildly variable and can take up to almost
306307
// 600-700ms sometimes.
307-
expect(end - start).to.be.within(1500, 1500 + 800);
308+
expect(end - start).to.be.within(timeoutMS - 100, timeoutMS + 800);
308309
expect(commands.map(({ commandName }) => commandName)).to.have.lengthOf(2);
309310
}
310311
);

0 commit comments

Comments
 (0)