Skip to content

Commit

Permalink
chore: skip bulkWrite with w:0 test failing on latest (mongodb#4064)
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Apr 15, 2024
1 parent cb5da65 commit 17d6497
Showing 1 changed file with 26 additions and 21 deletions.
47 changes: 26 additions & 21 deletions test/integration/crud/bulk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -723,32 +723,37 @@ describe('Bulk', function () {
}
});

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

const bulk = col.initializeOrderedBulkOp();
for (let i = 0; i < 100; i++) {
bulk.insert({ a: 1 });
}
const bulk = col.initializeOrderedBulkOp();
for (let i = 0; i < 100; i++) {
bulk.insert({ a: 1 });
}

bulk.find({ b: 1 }).upsert().update({ b: 1 });
bulk.find({ c: 1 }).delete();
bulk.find({ b: 1 }).upsert().update({ b: 1 });
bulk.find({ c: 1 }).delete();

bulk.execute({ writeConcern: { w: 0 } }, function (err, result) {
expect(err).to.not.exist;
test.equal(0, result.upsertedCount);
test.equal(0, result.insertedCount);
test.equal(0, result.matchedCount);
test.ok(0 === result.modifiedCount || result.modifiedCount == null);
test.equal(0, result.deletedCount);
test.equal(false, result.hasWriteErrors());
bulk.execute({ writeConcern: { w: 0 } }, function (err, result) {
expect(err).to.not.exist;
test.equal(0, result.upsertedCount);
test.equal(0, result.insertedCount);
test.equal(0, result.matchedCount);
test.ok(0 === result.modifiedCount || result.modifiedCount == null);
test.equal(0, result.deletedCount);
test.equal(false, result.hasWriteErrors());

client.close(done);
client.close(done);
});
});
});
});
}
);

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

0 comments on commit 17d6497

Please sign in to comment.