summaryrefslogtreecommitdiff
path: root/jstests/replsets/drain.js
diff options
context:
space:
mode:
authorJames Wahlin <james.wahlin@mongodb.com>2019-08-14 13:52:59 +0000
committerevergreen <evergreen@mongodb.com>2019-08-14 13:52:59 +0000
commit39c3a5d77b976e131d37476f2e7255d6058f5093 (patch)
tree01cc28719f215b17196ec913f475cd8efda9b37d /jstests/replsets/drain.js
parent69d0dd1dc4fb1f78d21c47aa5dd82aa9077b69eb (diff)
downloadmongo-39c3a5d77b976e131d37476f2e7255d6058f5093.tar.gz
SERVER-42773 Replace uses of the assert.writeOK() Javascript assertion with assert.commandWorked()
Diffstat (limited to 'jstests/replsets/drain.js')
-rw-r--r--jstests/replsets/drain.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/jstests/replsets/drain.js b/jstests/replsets/drain.js
index e1d008aebc0..7a8bdea6a53 100644
--- a/jstests/replsets/drain.js
+++ b/jstests/replsets/drain.js
@@ -32,7 +32,7 @@ var secondary = replSet.getSecondary();
var numDocuments = 20;
var bulk = primary.getDB("foo").foo.initializeUnorderedBulkOp();
var bigString = Array(1024 * 1024).toString();
-assert.writeOK(primary.getDB("foo").foo.insert({big: bigString}));
+assert.commandWorked(primary.getDB("foo").foo.insert({big: bigString}));
replSet.awaitReplication();
assert.commandWorked(
secondary.getDB("admin").runCommand({configureFailPoint: 'rsSyncApplyStop', mode: 'alwaysOn'}),
@@ -42,7 +42,7 @@ var bufferCountBefore = secondary.getDB('foo').serverStatus().metrics.repl.buffe
for (var i = 1; i < numDocuments; ++i) {
bulk.insert({big: bigString});
}
-assert.writeOK(bulk.execute());
+assert.commandWorked(bulk.execute());
jsTestLog('Number of documents inserted into collection on primary: ' + numDocuments);
assert.eq(numDocuments, primary.getDB("foo").foo.find().itcount());
@@ -101,7 +101,7 @@ assert.commandWorked(
// Ensure new primary is writable
jsTestLog('New primary should be writable after draining is complete');
-assert.writeOK(primary.getDB("foo").flag.insert({sentinel: 1}));
+assert.commandWorked(primary.getDB("foo").flag.insert({sentinel: 1}));
// Check for at least two entries. There was one prior to freezing op application on the
// secondary and we cannot guarantee all writes reached the secondary's op queue prior to
// shutting down the original primary.