Skip to content

Commit c429e34

Browse files
chore: skip bulkWrite with w:0 test failing on latest (#4064)
1 parent a5a7b89 commit c429e34

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed

test/integration/crud/bulk.test.ts

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -652,32 +652,37 @@ describe('Bulk', function () {
652652
}
653653
});
654654

655-
it('should correctly execute ordered batch using w:0', function (done) {
656-
client.connect((err, client) => {
657-
const db = client.db();
658-
const col = db.collection('batch_write_ordered_ops_9');
655+
it(
656+
'should correctly execute ordered batch using w:0',
657+
// TODO(NODE-6060): set `moreToCome` op_msg bit when `w: 0` is specified
658+
{ requires: { mongodb: '<8.0.0' } },
659+
function (done) {
660+
client.connect((err, client) => {
661+
const db = client.db();
662+
const col = db.collection('batch_write_ordered_ops_9');
659663

660-
const bulk = col.initializeOrderedBulkOp();
661-
for (let i = 0; i < 100; i++) {
662-
bulk.insert({ a: 1 });
663-
}
664+
const bulk = col.initializeOrderedBulkOp();
665+
for (let i = 0; i < 100; i++) {
666+
bulk.insert({ a: 1 });
667+
}
664668

665-
bulk.find({ b: 1 }).upsert().update({ b: 1 });
666-
bulk.find({ c: 1 }).delete();
669+
bulk.find({ b: 1 }).upsert().update({ b: 1 });
670+
bulk.find({ c: 1 }).delete();
667671

668-
bulk.execute({ writeConcern: { w: 0 } }, function (err, result) {
669-
expect(err).to.not.exist;
670-
test.equal(0, result.upsertedCount);
671-
test.equal(0, result.insertedCount);
672-
test.equal(0, result.matchedCount);
673-
test.ok(0 === result.modifiedCount || result.modifiedCount == null);
674-
test.equal(0, result.deletedCount);
675-
test.equal(false, result.hasWriteErrors());
672+
bulk.execute({ writeConcern: { w: 0 } }, function (err, result) {
673+
expect(err).to.not.exist;
674+
test.equal(0, result.upsertedCount);
675+
test.equal(0, result.insertedCount);
676+
test.equal(0, result.matchedCount);
677+
test.ok(0 === result.modifiedCount || result.modifiedCount == null);
678+
test.equal(0, result.deletedCount);
679+
test.equal(false, result.hasWriteErrors());
676680

677-
client.close(done);
681+
client.close(done);
682+
});
678683
});
679-
});
680-
});
684+
}
685+
);
681686

682687
it('should correctly handle single unordered batch API', function (done) {
683688
client.connect((err, client) => {

0 commit comments

Comments
 (0)