diff options
Diffstat (limited to 'jstests/noPassthroughWithMongod')
33 files changed, 75 insertions, 73 deletions
diff --git a/jstests/noPassthroughWithMongod/background.js b/jstests/noPassthroughWithMongod/background.js index 7624d24471c..ef591fa5114 100644 --- a/jstests/noPassthroughWithMongod/background.js +++ b/jstests/noPassthroughWithMongod/background.js @@ -11,7 +11,7 @@ var bulk = t.initializeUnorderedBulkOp(); for (var i = 0; i < 100000; i++) { bulk.insert({y: 'aaaaaaaaaaaa', i: i}); if (i % 10000 == 0) { - assert.writeOK(bulk.execute()); + assert.commandWorked(bulk.execute()); bulk = t.initializeUnorderedBulkOp(); print(i); } @@ -26,13 +26,13 @@ for (var i = 0; i < 100000; i++) { bulk.insert({i: i}); if (i % 10000 == 0) { printjson(db.currentOp()); - assert.writeOK(bulk.execute()); + assert.commandWorked(bulk.execute()); bulk = t.initializeUnorderedBulkOp(); print(i); } } -assert.writeOK(bulk.execute()); +assert.commandWorked(bulk.execute()); printjson(db.currentOp()); diff --git a/jstests/noPassthroughWithMongod/bench_test_crud_commands.js b/jstests/noPassthroughWithMongod/bench_test_crud_commands.js index e6db1e1bcb9..24b7f8858ef 100644 --- a/jstests/noPassthroughWithMongod/bench_test_crud_commands.js +++ b/jstests/noPassthroughWithMongod/bench_test_crud_commands.js @@ -42,7 +42,7 @@ function testInsert(docs, writeCmd, wc) { function testFind(readCmd) { coll.drop(); for (var i = 0; i < 100; i++) { - assert.writeOK(coll.insert({})); + assert.commandWorked(coll.insert({})); } var res = executeBenchRun([ @@ -54,7 +54,7 @@ function testFind(readCmd) { function testFindOne(readCmd) { coll.drop(); for (var i = 0; i < 100; i++) { - assert.writeOK(coll.insert({})); + assert.commandWorked(coll.insert({})); } var res = diff --git a/jstests/noPassthroughWithMongod/benchrun_substitution.js b/jstests/noPassthroughWithMongod/benchrun_substitution.js index b8562040e11..8d8eee3cc09 100644 --- a/jstests/noPassthroughWithMongod/benchrun_substitution.js +++ b/jstests/noPassthroughWithMongod/benchrun_substitution.js @@ -40,7 +40,7 @@ function benchrun_sub_update(use_write_command) { }]; for (var i = 0; i < 100; ++i) { - assert.writeOK(t.insert({x: i})); + assert.commandWorked(t.insert({x: i})); } res = benchRun({parallel: 1, seconds: 10, ops: ops, host: db.getMongo().host}); @@ -65,7 +65,7 @@ function benchrun_sub_remove(use_write_command) { }]; for (var i = 0; i < 100; ++i) { - assert.writeOK(t.insert({x: i})); + assert.commandWorked(t.insert({x: i})); } res = benchRun({parallel: 1, seconds: 10, ops: ops, host: db.getMongo().host}); diff --git a/jstests/noPassthroughWithMongod/btreedel.js b/jstests/noPassthroughWithMongod/btreedel.js index 76a0f909cc0..868a26fafba 100644 --- a/jstests/noPassthroughWithMongod/btreedel.js +++ b/jstests/noPassthroughWithMongod/btreedel.js @@ -8,7 +8,7 @@ var bulk = t.initializeUnorderedBulkOp(); for (var i = 0; i < 1000000; i++) {
bulk.insert({_id: i, x: 'a b'});
}
-assert.writeOK(bulk.execute());
+assert.commandWorked(bulk.execute());
print("1 insert done count: " + t.count());
diff --git a/jstests/noPassthroughWithMongod/capped_truncate.js b/jstests/noPassthroughWithMongod/capped_truncate.js index 25e023c890d..4fef292493c 100644 --- a/jstests/noPassthroughWithMongod/capped_truncate.js +++ b/jstests/noPassthroughWithMongod/capped_truncate.js @@ -23,7 +23,7 @@ assert.commandFailed(db.runCommand({captrunc: "capped_truncate", n: 0}), "captrunc didn't return an error when attempting to remove 0 documents"); for (var j = 1; j <= 10; j++) { - assert.writeOK(t.insert({x: j})); + assert.commandWorked(t.insert({x: j})); } // It is an error to try and remove more documents than what exist in the capped collection. @@ -50,7 +50,7 @@ db[collName].drop(); assert.commandWorked(db.runCommand({create: collName, capped: false})); for (var j = 1; j <= 10; j++) { - assert.writeOK(db[collName].insert({x: j})); + assert.commandWorked(db[collName].insert({x: j})); } assert.commandFailed(db.runCommand({captrunc: collName, n: 5}), "captrunc didn't return an error for a non-capped collection"); diff --git a/jstests/noPassthroughWithMongod/cursor_server_status_metrics.js b/jstests/noPassthroughWithMongod/cursor_server_status_metrics.js index 865809f63b2..ab02eb6960b 100644 --- a/jstests/noPassthroughWithMongod/cursor_server_status_metrics.js +++ b/jstests/noPassthroughWithMongod/cursor_server_status_metrics.js @@ -4,9 +4,9 @@ (function() { var coll = db[jsTest.name()]; coll.drop(); -assert.writeOK(coll.insert({_id: 1})); -assert.writeOK(coll.insert({_id: 2})); -assert.writeOK(coll.insert({_id: 3})); +assert.commandWorked(coll.insert({_id: 1})); +assert.commandWorked(coll.insert({_id: 2})); +assert.commandWorked(coll.insert({_id: 3})); assert.eq(3, coll.find().count()); diff --git a/jstests/noPassthroughWithMongod/find_and_modify_server16469.js b/jstests/noPassthroughWithMongod/find_and_modify_server16469.js index 43f6ed3910c..70fe0651748 100644 --- a/jstests/noPassthroughWithMongod/find_and_modify_server16469.js +++ b/jstests/noPassthroughWithMongod/find_and_modify_server16469.js @@ -24,7 +24,7 @@ try { largeStr += 'x'; } for (var i = 0; i < 100; ++i) { - assert.writeOK(coll.insert({a: largeStr, b: i})); + assert.commandWorked(coll.insert({a: largeStr, b: i})); } // Verify that an unindexed sort of this data fails with a find() if no limit is specified. diff --git a/jstests/noPassthroughWithMongod/find_cmd.js b/jstests/noPassthroughWithMongod/find_cmd.js index a1eac6b24f5..7ce8e52855d 100644 --- a/jstests/noPassthroughWithMongod/find_cmd.js +++ b/jstests/noPassthroughWithMongod/find_cmd.js @@ -25,7 +25,7 @@ assert.eq([], res.cursor.firstBatch); if (jsTest.options().storageEngine !== "mobile") { coll.drop(); assert.commandWorked(coll.getDB().createCollection(collname, {capped: true, size: 2048})); - assert.writeOK(coll.insert({_id: 1})); + assert.commandWorked(coll.insert({_id: 1})); res = coll.runCommand("find", {tailable: true}); assert.commandWorked(res); assert.neq(0, res.cursor.id); @@ -35,7 +35,7 @@ if (jsTest.options().storageEngine !== "mobile") { // Multiple batches. coll.drop(); for (var i = 0; i < 150; i++) { - assert.writeOK(coll.insert({_id: i})); + assert.commandWorked(coll.insert({_id: i})); } res = coll.runCommand("find", {filter: {_id: {$lt: 140}}}); assert.commandWorked(res); diff --git a/jstests/noPassthroughWithMongod/geo_mnypts.js b/jstests/noPassthroughWithMongod/geo_mnypts.js index 5a936a3490d..d3ae714b69b 100644 --- a/jstests/noPassthroughWithMongod/geo_mnypts.js +++ b/jstests/noPassthroughWithMongod/geo_mnypts.js @@ -11,7 +11,7 @@ for (var i = 0; i < totalPts; i++) { var ii = i % 10000; bulk.insert({loc: [ii % 100, Math.floor(ii / 100)]}); } -assert.writeOK(bulk.execute()); +assert.commandWorked(bulk.execute()); coll.ensureIndex({loc: "2d"}); diff --git a/jstests/noPassthroughWithMongod/geo_polygon.js b/jstests/noPassthroughWithMongod/geo_polygon.js index 4d10d62a7dd..ce7f9ebf67c 100644 --- a/jstests/noPassthroughWithMongod/geo_polygon.js +++ b/jstests/noPassthroughWithMongod/geo_polygon.js @@ -13,7 +13,7 @@ for (x = -180; x < 180; x += .5) { bulk.insert(o); } } -assert.writeOK(bulk.execute()); +assert.commandWorked(bulk.execute()); var numTests = 31; for (var n = 0; n < numTests; n++) { diff --git a/jstests/noPassthroughWithMongod/getmore_awaitdata_opcounters.js b/jstests/noPassthroughWithMongod/getmore_awaitdata_opcounters.js index e63d4f828ae..e925222c3f7 100644 --- a/jstests/noPassthroughWithMongod/getmore_awaitdata_opcounters.js +++ b/jstests/noPassthroughWithMongod/getmore_awaitdata_opcounters.js @@ -8,9 +8,9 @@ const coll = db.getmore_awaitdata_opcounters; coll.drop(); assert.commandWorked(db.createCollection(coll.getName(), {capped: true, size: 1024})); -assert.writeOK(coll.insert({_id: 1})); -assert.writeOK(coll.insert({_id: 2})); -assert.writeOK(coll.insert({_id: 3})); +assert.commandWorked(coll.insert({_id: 1})); +assert.commandWorked(coll.insert({_id: 2})); +assert.commandWorked(coll.insert({_id: 3})); function getGlobalLatencyStats() { return db.serverStatus().opLatencies.reads; diff --git a/jstests/noPassthroughWithMongod/index_boundary_values_validate.js b/jstests/noPassthroughWithMongod/index_boundary_values_validate.js index 5ff5a44ef93..50ab5497c32 100644 --- a/jstests/noPassthroughWithMongod/index_boundary_values_validate.js +++ b/jstests/noPassthroughWithMongod/index_boundary_values_validate.js @@ -6,15 +6,15 @@ var t = db.index_boundary_values_validate; t.drop(); -assert.writeOK(t.insert({a: MaxKey, b: MaxKey})); -assert.writeOK(t.insert({a: MaxKey, b: MinKey})); -assert.writeOK(t.insert({a: MinKey, b: MaxKey})); -assert.writeOK(t.insert({a: MinKey, b: MinKey})); +assert.commandWorked(t.insert({a: MaxKey, b: MaxKey})); +assert.commandWorked(t.insert({a: MaxKey, b: MinKey})); +assert.commandWorked(t.insert({a: MinKey, b: MaxKey})); +assert.commandWorked(t.insert({a: MinKey, b: MinKey})); -assert.writeOK(t.insert({a: {}})); -assert.writeOK(t.insert({b: {}})); -assert.writeOK(t.insert({unindexed_field: {}})); -assert.writeOK(t.insert({a: {}, b: {}})); +assert.commandWorked(t.insert({a: {}})); +assert.commandWorked(t.insert({b: {}})); +assert.commandWorked(t.insert({unindexed_field: {}})); +assert.commandWorked(t.insert({a: {}, b: {}})); assert.commandWorked(t.createIndex({a: 1, b: 1})); assert.commandWorked(t.createIndex({a: 1, b: -1})); diff --git a/jstests/noPassthroughWithMongod/index_check10.js b/jstests/noPassthroughWithMongod/index_check10.js index 2816eecdb4b..e0786a4e539 100644 --- a/jstests/noPassthroughWithMongod/index_check10.js +++ b/jstests/noPassthroughWithMongod/index_check10.js @@ -106,7 +106,7 @@ function doIt() { for (var i = 0; i < 10000; ++i) { bulk.insert(obj()); } - assert.writeOK(bulk.execute()); + assert.commandWorked(bulk.execute()); t.ensureIndex(idx); check(); @@ -120,12 +120,12 @@ function doIt() { } if (Random.rand() > 0.999) { print(i); - assert.writeOK(bulk.execute()); + assert.commandWorked(bulk.execute()); check(); bulk = t.initializeUnorderedBulkOp(); } } - assert.writeOK(bulk.execute()); + assert.commandWorked(bulk.execute()); check(); } diff --git a/jstests/noPassthroughWithMongod/index_check9.js b/jstests/noPassthroughWithMongod/index_check9.js index fe158efbdad..8a693604bb8 100644 --- a/jstests/noPassthroughWithMongod/index_check9.js +++ b/jstests/noPassthroughWithMongod/index_check9.js @@ -107,7 +107,7 @@ function doIt() { bulk.insert(obj()); if (Random.rand() > 0.999) { print(i); - assert.writeOK(bulk.execute()); + assert.commandWorked(bulk.execute()); check(); bulk = t.initializeUnorderedBulkOp(); } @@ -122,12 +122,12 @@ function doIt() { } if (Random.rand() > 0.999) { print(i); - assert.writeOK(bulk.execute()); + assert.commandWorked(bulk.execute()); check(); bulk = t.initializeUnorderedBulkOp(); } } - assert.writeOK(bulk.execute()); + assert.commandWorked(bulk.execute()); check(); } diff --git a/jstests/noPassthroughWithMongod/index_hammer1.js b/jstests/noPassthroughWithMongod/index_hammer1.js index 5d89223093e..d1ecd2c5213 100644 --- a/jstests/noPassthroughWithMongod/index_hammer1.js +++ b/jstests/noPassthroughWithMongod/index_hammer1.js @@ -5,7 +5,7 @@ t.drop(); var bulk = t.initializeUnorderedBulkOp(); for (i = 0; i < 10000; i++) bulk.insert({x: i, y: i}); -assert.writeOK(bulk.execute()); +assert.commandWorked(bulk.execute()); ops = []; diff --git a/jstests/noPassthroughWithMongod/indexbg_interrupts.js b/jstests/noPassthroughWithMongod/indexbg_interrupts.js index d25a32e857b..218002b0cc6 100644 --- a/jstests/noPassthroughWithMongod/indexbg_interrupts.js +++ b/jstests/noPassthroughWithMongod/indexbg_interrupts.js @@ -73,7 +73,7 @@ for (var idx = 0; idx < dropAction.length; idx++) { for (var i = 0; i < size; ++i) { bulk.insert({i: i}); } - assert.writeOK(bulk.execute()); + assert.commandWorked(bulk.execute()); jsTest.log("Starting background indexing for test of: " + JSON.stringify(dc)); masterDB.getCollection(collection).ensureIndex({i: 1}, {background: true}); diff --git a/jstests/noPassthroughWithMongod/indexbg_restart_secondary.js b/jstests/noPassthroughWithMongod/indexbg_restart_secondary.js index 446502905cb..2e5d2e85bf6 100644 --- a/jstests/noPassthroughWithMongod/indexbg_restart_secondary.js +++ b/jstests/noPassthroughWithMongod/indexbg_restart_secondary.js @@ -40,7 +40,7 @@ var bulk = masterDB.jstests_bgsec.initializeUnorderedBulkOp(); for (var i = 0; i < size; ++i) { bulk.insert({i: i}); } -assert.writeOK(bulk.execute({j: true})); +assert.commandWorked(bulk.execute({j: true})); assert.eq(size, coll.count(), 'unexpected number of documents after bulk insert.'); // Make sure the documents make it to the secondary. diff --git a/jstests/noPassthroughWithMongod/indexbg_restart_secondary_noretry.js b/jstests/noPassthroughWithMongod/indexbg_restart_secondary_noretry.js index 16165ce3f96..19fbb4b4879 100644 --- a/jstests/noPassthroughWithMongod/indexbg_restart_secondary_noretry.js +++ b/jstests/noPassthroughWithMongod/indexbg_restart_secondary_noretry.js @@ -56,7 +56,7 @@ var bulk = masterColl.initializeUnorderedBulkOp(); for (var i = 0; i < size; ++i) { bulk.insert({i: i}); } -assert.writeOK(bulk.execute({j: true})); +assert.commandWorked(bulk.execute({j: true})); assert.eq(size, masterColl.count(), 'unexpected number of documents after bulk insert.'); // Make sure the documents get replicated to the secondary. diff --git a/jstests/noPassthroughWithMongod/indexbg_updates.js b/jstests/noPassthroughWithMongod/indexbg_updates.js index 5511c83074d..136c0118e0e 100644 --- a/jstests/noPassthroughWithMongod/indexbg_updates.js +++ b/jstests/noPassthroughWithMongod/indexbg_updates.js @@ -19,7 +19,7 @@ for (var i = 0; i < numDocs; i++) { bulk.insert(doc); } -assert.writeOK(bulk.execute()); +assert.commandWorked(bulk.execute()); // Perform a bulk update on a single document, targeting the updates on the // field being actively indexed in the background @@ -50,7 +50,7 @@ var backgroundIndexBuildShell = startParallelShell( ); print("Do some sets and unsets"); -assert.writeOK(bulk.execute()); +assert.commandWorked(bulk.execute()); print("Start background index build"); backgroundIndexBuildShell(); diff --git a/jstests/noPassthroughWithMongod/isMaster_feature_compatibility_version.js b/jstests/noPassthroughWithMongod/isMaster_feature_compatibility_version.js index 10a019e95cf..a14fecd2d5b 100644 --- a/jstests/noPassthroughWithMongod/isMaster_feature_compatibility_version.js +++ b/jstests/noPassthroughWithMongod/isMaster_feature_compatibility_version.js @@ -22,7 +22,7 @@ assert.eq(res.minWireVersion, res.maxWireVersion, tojson(res)); // When the featureCompatibilityVersion is upgrading, running isMaster with internalClient // returns minWireVersion == maxWireVersion. -assert.writeOK( +assert.commandWorked( adminDB.system.version.update({_id: "featureCompatibilityVersion"}, {$set: {version: lastStableFCV, targetVersion: latestFCV}})); res = adminDB.runCommand(isMasterCommand); @@ -31,7 +31,7 @@ assert.eq(res.minWireVersion, res.maxWireVersion, tojson(res)); // When the featureCompatibilityVersion is downgrading, running isMaster with internalClient // returns minWireVersion == maxWireVersion. -assert.writeOK( +assert.commandWorked( adminDB.system.version.update({_id: "featureCompatibilityVersion"}, {$set: {version: lastStableFCV, targetVersion: lastStableFCV}})); res = adminDB.runCommand(isMasterCommand); diff --git a/jstests/noPassthroughWithMongod/mapreduce_intermediate_reduce.js b/jstests/noPassthroughWithMongod/mapreduce_intermediate_reduce.js index 589e072b631..52bd8b22ceb 100644 --- a/jstests/noPassthroughWithMongod/mapreduce_intermediate_reduce.js +++ b/jstests/noPassthroughWithMongod/mapreduce_intermediate_reduce.js @@ -21,7 +21,7 @@ for (var i = 0; i < 10; i++) { }
expectedOutColl.push({_id: i, value: j - 1});
}
-assert.writeOK(bulk.execute());
+assert.commandWorked(bulk.execute());
function mapFn() {
emit(this.idx, 1);
diff --git a/jstests/noPassthroughWithMongod/mr_writeconflict.js b/jstests/noPassthroughWithMongod/mr_writeconflict.js index b7fd81e21c7..6dfd3189196 100644 --- a/jstests/noPassthroughWithMongod/mr_writeconflict.js +++ b/jstests/noPassthroughWithMongod/mr_writeconflict.js @@ -49,7 +49,7 @@ for (i = 0; i < numDocs; ++i) { } var res = bulk.execute(); -assert.writeOK(res); +assert.commandWorked(res); assert.eq(numDocs, res.nInserted); db.dest.drop(); diff --git a/jstests/noPassthroughWithMongod/no_balance_collection.js b/jstests/noPassthroughWithMongod/no_balance_collection.js index b548ce13cd9..6549126a9dc 100644 --- a/jstests/noPassthroughWithMongod/no_balance_collection.js +++ b/jstests/noPassthroughWithMongod/no_balance_collection.js @@ -81,7 +81,7 @@ var bulk = collB.initializeUnorderedBulkOp(); for (var i = 0; i < 1000000; i++) { bulk.insert({_id: i, hello: "world"}); } -assert.writeOK(bulk.execute()); +assert.commandWorked(bulk.execute()); printjson(lastMigration); printjson(sh._lastMigration(collB)); diff --git a/jstests/noPassthroughWithMongod/remove9.js b/jstests/noPassthroughWithMongod/remove9.js index b7da7b58f95..ba5fd220795 100644 --- a/jstests/noPassthroughWithMongod/remove9.js +++ b/jstests/noPassthroughWithMongod/remove9.js @@ -7,7 +7,7 @@ pid = startMongoProgramNoConnect("mongo", "--eval", js, db ? db.getMongo().host Random.setRandomSeed(); for (var i = 0; i < 10000; ++i) { - assert.writeOK(t.remove({i: Random.randInt(10000)})); + assert.commandWorked(t.remove({i: Random.randInt(10000)})); } stopMongoProgramByPid(pid); diff --git a/jstests/noPassthroughWithMongod/sharding_migrate_large_docs.js b/jstests/noPassthroughWithMongod/sharding_migrate_large_docs.js index 38542deed0a..7deaf3999a8 100644 --- a/jstests/noPassthroughWithMongod/sharding_migrate_large_docs.js +++ b/jstests/noPassthroughWithMongod/sharding_migrate_large_docs.js @@ -40,13 +40,13 @@ coll.insert({_id: -2, d: data15PlusMB}); coll.insert({_id: -1, d: data15PlusMB}); // Docs of assorted sizes -assert.writeOK(coll.insert({_id: 0, d: "x"})); -assert.writeOK(coll.insert({_id: 1, d: data15PlusMB})); -assert.writeOK(coll.insert({_id: 2, d: "x"})); -assert.writeOK(coll.insert({_id: 3, d: data15MB})); -assert.writeOK(coll.insert({_id: 4, d: "x"})); -assert.writeOK(coll.insert({_id: 5, d: data1MB})); -assert.writeOK(coll.insert({_id: 6, d: "x"})); +assert.commandWorked(coll.insert({_id: 0, d: "x"})); +assert.commandWorked(coll.insert({_id: 1, d: data15PlusMB})); +assert.commandWorked(coll.insert({_id: 2, d: "x"})); +assert.commandWorked(coll.insert({_id: 3, d: data15MB})); +assert.commandWorked(coll.insert({_id: 4, d: "x"})); +assert.commandWorked(coll.insert({_id: 5, d: data1MB})); +assert.commandWorked(coll.insert({_id: 6, d: "x"})); assert.eq(9, coll.find().itcount()); diff --git a/jstests/noPassthroughWithMongod/skip_shell_cursor_finalize.js b/jstests/noPassthroughWithMongod/skip_shell_cursor_finalize.js index a1968b7db90..6071aed73e5 100644 --- a/jstests/noPassthroughWithMongod/skip_shell_cursor_finalize.js +++ b/jstests/noPassthroughWithMongod/skip_shell_cursor_finalize.js @@ -6,7 +6,7 @@ const coll = db.skip_shell_cursor_finalize; coll.drop(); for (let i = 0; i < 3; i++) { - assert.writeOK(coll.insert({_id: i})); + assert.commandWorked(coll.insert({_id: i})); } function checkShellCursorFinalize(skip = true) { diff --git a/jstests/noPassthroughWithMongod/tailable_getmore_does_not_timeout.js b/jstests/noPassthroughWithMongod/tailable_getmore_does_not_timeout.js index 600d8be4733..54c00aa554d 100644 --- a/jstests/noPassthroughWithMongod/tailable_getmore_does_not_timeout.js +++ b/jstests/noPassthroughWithMongod/tailable_getmore_does_not_timeout.js @@ -15,7 +15,7 @@ coll.drop(); assert.commandWorked(db.runCommand({create: coll.getName(), capped: true, size: 1024})); for (let i = 0; i < 10; ++i) { - assert.writeOK(coll.insert({_id: i})); + assert.commandWorked(coll.insert({_id: i})); } const findResponse = assert.commandWorked( diff --git a/jstests/noPassthroughWithMongod/top_drop.js b/jstests/noPassthroughWithMongod/top_drop.js index 61f1736a2bb..bf4866f05c6 100644 --- a/jstests/noPassthroughWithMongod/top_drop.js +++ b/jstests/noPassthroughWithMongod/top_drop.js @@ -56,9 +56,9 @@ function checkTopEntries(expectedEntries) { } // Create a few entries in top. -assert.writeOK(topDB.coll1.insert({})); -assert.writeOK(topDB.coll2.insert({})); -assert.writeOK(topDB.coll3.insert({})); +assert.commandWorked(topDB.coll1.insert({})); +assert.commandWorked(topDB.coll2.insert({})); +assert.commandWorked(topDB.coll3.insert({})); checkTopEntries([topDB.coll1, topDB.coll2, topDB.coll3]); // Check that dropping a collection removes that collection but leaves the others. diff --git a/jstests/noPassthroughWithMongod/ttl_repl.js b/jstests/noPassthroughWithMongod/ttl_repl.js index b0c7c342987..1d1f3f001ee 100644 --- a/jstests/noPassthroughWithMongod/ttl_repl.js +++ b/jstests/noPassthroughWithMongod/ttl_repl.js @@ -35,7 +35,7 @@ var bulk = mastercol.initializeUnorderedBulkOp(); for (i = 0; i < 24; i++) { bulk.insert({x: new Date(now - (3600 * 1000 * i))}); } -assert.writeOK(bulk.execute()); +assert.commandWorked(bulk.execute()); rt.awaitReplication(); assert.eq(24, mastercol.count(), "docs not inserted on primary"); assert.eq(24, slave1col.count(), "docs not inserted on secondary"); diff --git a/jstests/noPassthroughWithMongod/ttl_repl_maintenance.js b/jstests/noPassthroughWithMongod/ttl_repl_maintenance.js index 4616a306084..0cdec8e1845 100644 --- a/jstests/noPassthroughWithMongod/ttl_repl_maintenance.js +++ b/jstests/noPassthroughWithMongod/ttl_repl_maintenance.js @@ -36,7 +36,7 @@ var restartWithConfig = function() { var restartWithoutConfig = function() { var localDB = conn.getDB("local"); - assert.writeOK(localDB.system.replset.remove({})); + assert.commandWorked(localDB.system.replset.remove({})); MongoRunner.stopMongod(conn); diff --git a/jstests/noPassthroughWithMongod/ttl_sharded.js b/jstests/noPassthroughWithMongod/ttl_sharded.js index 6788dfcdcf9..5c59b1851ad 100644 --- a/jstests/noPassthroughWithMongod/ttl_sharded.js +++ b/jstests/noPassthroughWithMongod/ttl_sharded.js @@ -28,7 +28,7 @@ for (var i = 0; i < 24; i++) { var past = new Date(now - (3600 * 1000 * i)); bulk.insert({_id: i, x: past}); } -assert.writeOK(bulk.execute()); +assert.commandWorked(bulk.execute()); assert.eq(t.count(), 24, "initial docs not inserted"); // create the TTL index which delete anything older than ~5.5 hours diff --git a/jstests/noPassthroughWithMongod/validate_interrupt.js b/jstests/noPassthroughWithMongod/validate_interrupt.js index c19e682eae3..ecba9cb8756 100644 --- a/jstests/noPassthroughWithMongod/validate_interrupt.js +++ b/jstests/noPassthroughWithMongod/validate_interrupt.js @@ -13,7 +13,7 @@ var i; for (i = 0; i < 1000; i++) { bulk.insert({a: i}); } -assert.writeOK(bulk.execute()); +assert.commandWorked(bulk.execute()); function setTimeoutFailPoint(mode) { var res = db.adminCommand({configureFailPoint: 'maxTimeAlwaysTimeOut', mode: mode}); diff --git a/jstests/noPassthroughWithMongod/views_invalid.js b/jstests/noPassthroughWithMongod/views_invalid.js index a525b68d32f..dfe253c8848 100644 --- a/jstests/noPassthroughWithMongod/views_invalid.js +++ b/jstests/noPassthroughWithMongod/views_invalid.js @@ -6,17 +6,18 @@ let invalidDB = db.getSiblingDB(dbname); // Wait for the invalid view definition to be replicated to any secondaries and then drop the // database. -assert.writeOK(invalidDB.system.views.insert({z: '\0\uFFFFf'}), {writeConcern: {w: "majority"}}); +assert.commandWorked(invalidDB.system.views.insert({z: '\0\uFFFFf'}), + {writeConcern: {w: "majority"}}); invalidDB.dropDatabase(); // Create a database with one valid and one invalid view through direct system.views writes. -assert.writeOK(invalidDB.coll.insert({x: 1})); -assert.writeOK( +assert.commandWorked(invalidDB.coll.insert({x: 1})); +assert.commandWorked( invalidDB.system.views.insert({_id: dbname + '.view', viewOn: 'coll', pipeline: []})); assert.eq(invalidDB.view.findOne({}, {_id: 0}), {x: 1}, 'find on view created with direct write to views catalog should work'); -assert.writeOK(invalidDB.system.views.insert({_id: 'invalid', pipeline: 3.0})); +assert.commandWorked(invalidDB.system.views.insert({_id: 'invalid', pipeline: 3.0})); // Check that view-related commands fail with an invalid view catalog, but other commands on // existing collections still succeed. @@ -28,8 +29,8 @@ assert.eq(invalidDB.coll.findOne({}, {_id: 0}), {x: 1}, 'find on existing collection in DB with invalid views catalog should work'); -assert.writeOK(invalidDB.coll.insert({x: 2}), - 'insert in existing collection in DB with invalid views catalog should work'); +assert.commandWorked(invalidDB.coll.insert({x: 2}), + 'insert in existing collection in DB with invalid views catalog should work'); assert.writeError(invalidDB.x.insert({x: 2}), 'insert into new collection in DB with invalid views catalog should fail'); @@ -53,10 +54,11 @@ assert.commandFailedWithCode( 'find on non-existent collection in DB with invalid system.views should fail'); // Now fix the database by removing the invalid system.views entry, and check all is OK. -assert.writeOK(invalidDB.system.views.remove({_id: 'invalid'}), - 'should be able to remove invalid view with direct write to view catalog'); -assert.writeOK(invalidDB.coll.insert({x: 1}), - 'after remove invalid view from catalog, should be able to create new collection'); +assert.commandWorked(invalidDB.system.views.remove({_id: 'invalid'}), + 'should be able to remove invalid view with direct write to view catalog'); +assert.commandWorked( + invalidDB.coll.insert({x: 1}), + 'after remove invalid view from catalog, should be able to create new collection'); assert.eq(invalidDB.view.findOne({}, {_id: 0}), {x: 1}, 'find on view should work again after removing invalid view from catalog'); |