diff options
author | James Wahlin <james.wahlin@mongodb.com> | 2019-08-14 13:52:59 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-08-14 13:52:59 +0000 |
commit | 39c3a5d77b976e131d37476f2e7255d6058f5093 (patch) | |
tree | 01cc28719f215b17196ec913f475cd8efda9b37d /jstests/sharding/coll_epoch_test2.js | |
parent | 69d0dd1dc4fb1f78d21c47aa5dd82aa9077b69eb (diff) | |
download | mongo-39c3a5d77b976e131d37476f2e7255d6058f5093.tar.gz |
SERVER-42773 Replace uses of the assert.writeOK() Javascript assertion with assert.commandWorked()
Diffstat (limited to 'jstests/sharding/coll_epoch_test2.js')
-rw-r--r-- | jstests/sharding/coll_epoch_test2.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/jstests/sharding/coll_epoch_test2.js b/jstests/sharding/coll_epoch_test2.js index 0033e59f57d..e01513adb04 100644 --- a/jstests/sharding/coll_epoch_test2.js +++ b/jstests/sharding/coll_epoch_test2.js @@ -32,7 +32,7 @@ assert.commandWorked(admin.runCommand({enableSharding: coll.getDB() + ""})); st.ensurePrimaryShard(coll.getDB().getName(), st.shard1.shardName); assert.commandWorked(admin.runCommand({shardCollection: coll + "", key: {_id: 1}})); -assert.writeOK(coll.insert({hello: "world"})); +assert.commandWorked(coll.insert({hello: "world"})); jsTest.log("Sharding collection across multiple shards..."); @@ -86,7 +86,7 @@ assert.commandWorked(admin.runCommand({shardCollection: coll + "", key: {_id: 1} var bulk = coll.initializeUnorderedBulkOp(); for (var i = 0; i < 100; i++) bulk.insert({_id: i}); -assert.writeOK(bulk.execute()); +assert.commandWorked(bulk.execute()); res = admin.runCommand({split: coll + "", middle: {_id: 200}}); assert.commandWorked(res); @@ -112,17 +112,18 @@ assert.neq(null, readMongos.getCollection(coll + "").findOne({_id: 1})); jsTest.log("Checking update..."); // Ensure that updating an element finds the right location -assert.writeOK(updateMongos.getCollection(coll + "").update({_id: 1}, {$set: {updated: true}})); +assert.commandWorked( + updateMongos.getCollection(coll + "").update({_id: 1}, {$set: {updated: true}})); assert.neq(null, coll.findOne({updated: true})); jsTest.log("Checking insert..."); // Ensure that inserting an element finds the right shard -assert.writeOK(insertMongos.getCollection(coll + "").insert({_id: 101})); +assert.commandWorked(insertMongos.getCollection(coll + "").insert({_id: 101})); assert.neq(null, coll.findOne({_id: 101})); jsTest.log("Checking remove..."); // Ensure that removing an element finds the right shard, verified by the mongos doing the sharding -assert.writeOK(removeMongos.getCollection(coll + "").remove({_id: 2})); +assert.commandWorked(removeMongos.getCollection(coll + "").remove({_id: 2})); assert.eq(null, coll.findOne({_id: 2})); coll.drop(); |