Skip to content

Commit fd9dc8b

Browse files
baileympearsonaditi-khare-mongoDB
authored andcommitted
chore: skip bulkWrite with w:0 test failing on latest (#4064)
1 parent c2e30e5 commit fd9dc8b

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed

Diff for: test/integration/crud/bulk.test.ts

+26-21
Original file line numberDiff line numberDiff line change
@@ -723,32 +723,37 @@ describe('Bulk', function () {
723723
}
724724
});
725725

726-
it('should correctly execute ordered batch using w:0', function (done) {
727-
client.connect((err, client) => {
728-
const db = client.db();
729-
const col = db.collection('batch_write_ordered_ops_9');
726+
it(
727+
'should correctly execute ordered batch using w:0',
728+
// TODO(NODE-6060): set `moreToCome` op_msg bit when `w: 0` is specified
729+
{ requires: { mongodb: '<8.0.0' } },
730+
function (done) {
731+
client.connect((err, client) => {
732+
const db = client.db();
733+
const col = db.collection('batch_write_ordered_ops_9');
730734

731-
const bulk = col.initializeOrderedBulkOp();
732-
for (let i = 0; i < 100; i++) {
733-
bulk.insert({ a: 1 });
734-
}
735+
const bulk = col.initializeOrderedBulkOp();
736+
for (let i = 0; i < 100; i++) {
737+
bulk.insert({ a: 1 });
738+
}
735739

736-
bulk.find({ b: 1 }).upsert().update({ b: 1 });
737-
bulk.find({ c: 1 }).delete();
740+
bulk.find({ b: 1 }).upsert().update({ b: 1 });
741+
bulk.find({ c: 1 }).delete();
738742

739-
bulk.execute({ writeConcern: { w: 0 } }, function (err, result) {
740-
expect(err).to.not.exist;
741-
test.equal(0, result.upsertedCount);
742-
test.equal(0, result.insertedCount);
743-
test.equal(0, result.matchedCount);
744-
test.ok(0 === result.modifiedCount || result.modifiedCount == null);
745-
test.equal(0, result.deletedCount);
746-
test.equal(false, result.hasWriteErrors());
743+
bulk.execute({ writeConcern: { w: 0 } }, function (err, result) {
744+
expect(err).to.not.exist;
745+
test.equal(0, result.upsertedCount);
746+
test.equal(0, result.insertedCount);
747+
test.equal(0, result.matchedCount);
748+
test.ok(0 === result.modifiedCount || result.modifiedCount == null);
749+
test.equal(0, result.deletedCount);
750+
test.equal(false, result.hasWriteErrors());
747751

748-
client.close(done);
752+
client.close(done);
753+
});
749754
});
750-
});
751-
});
755+
}
756+
);
752757

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

0 commit comments

Comments
 (0)