diff options
author | Kevin Albertson <kevin.albertson@10gen.com> | 2017-12-29 12:53:14 -0500 |
---|---|---|
committer | Kevin Albertson <kevin.albertson@10gen.com> | 2018-01-11 10:47:49 -0500 |
commit | 5e28f4a35229422ec48ba7611e67b414b0eeb77f (patch) | |
tree | 53f06c5ec5491bc7360396db90aa804c0fc58536 /jstests/core | |
parent | 9d1f323a131ba5e3e1af79973ae79910de10a957 (diff) | |
download | mongo-5e28f4a35229422ec48ba7611e67b414b0eeb77f.tar.gz |
SERVER-31335 cmd assertions check write errors
Diffstat (limited to 'jstests/core')
-rw-r--r-- | jstests/core/batch_write_command_delete.js | 4 | ||||
-rw-r--r-- | jstests/core/dbcase2.js | 3 | ||||
-rw-r--r-- | jstests/core/expr.js | 4 |
3 files changed, 5 insertions, 6 deletions
diff --git a/jstests/core/batch_write_command_delete.js b/jstests/core/batch_write_command_delete.js index 4e272571a34..85098662d6c 100644 --- a/jstests/core/batch_write_command_delete.js +++ b/jstests/core/batch_write_command_delete.js @@ -166,7 +166,7 @@ request = { ordered: true }; result = coll.runCommand(request); -assert.commandWorked(result); +assert.commandWorkedIgnoringWriteErrors(result); assert.eq(1, result.n); assert(result.writeErrors != null); assert.eq(1, result.writeErrors.length); @@ -187,7 +187,7 @@ request = { ordered: false }; result = coll.runCommand(request); -assert.commandWorked(result); +assert.commandWorkedIgnoringWriteErrors(result); assert.eq(1, result.n); assert.eq(2, result.writeErrors.length); diff --git a/jstests/core/dbcase2.js b/jstests/core/dbcase2.js index 2c3517e5e63..34c0597ab05 100644 --- a/jstests/core/dbcase2.js +++ b/jstests/core/dbcase2.js @@ -8,7 +8,6 @@ var resultLower = dbLowerCase.c.insert({}); assert.eq(1, resultLower.nInserted); var resultUpper = dbUpperCase.c.insert({}); -assert.eq(0, resultUpper.nInserted); -assert.writeError(resultUpper); +assert.commandFailed(resultUpper); assert.eq(-1, db.getMongo().getDBNames().indexOf("dbcase2test_dbnameA")); diff --git a/jstests/core/expr.js b/jstests/core/expr.js index d8636ded871..86bf9aef10a 100644 --- a/jstests/core/expr.js +++ b/jstests/core/expr.js @@ -296,7 +296,7 @@ delete: coll.getName(), deletes: [{q: {_id: 0}, limit: 1}, {q: {$expr: "$$unbound"}, limit: 1}] }); - assert.commandWorked(writeRes); + assert.commandWorkedIgnoringWriteErrors(writeRes); assert.eq(writeRes.writeErrors[0].code, 17276, tojson(writeRes)); assert.eq(writeRes.n, 1, tojson(writeRes)); @@ -344,7 +344,7 @@ update: coll.getName(), updates: [{q: {_id: 0}, u: {$set: {b: 6}}}, {q: {$expr: "$$unbound"}, u: {$set: {b: 6}}}] }); - assert.commandWorked(writeRes); + assert.commandWorkedIgnoringWriteErrors(writeRes); assert.eq(writeRes.writeErrors[0].code, 17276, tojson(writeRes)); assert.eq(writeRes.n, 1, tojson(writeRes)); })(); |