diff options
Diffstat (limited to 'jstests/replsets/tags_with_reconfig.js')
-rw-r--r-- | jstests/replsets/tags_with_reconfig.js | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/jstests/replsets/tags_with_reconfig.js b/jstests/replsets/tags_with_reconfig.js index 8de023f5d4e..755fd744de5 100644 --- a/jstests/replsets/tags_with_reconfig.js +++ b/jstests/replsets/tags_with_reconfig.js @@ -27,18 +27,11 @@ replTest.awaitReplication(); master = replTest.getMaster(); var db = master.getDB("test"); -// Insert a document and getLastError with write concern : anydc -db.foo.insert( {x:1} ); -var result = db.runCommand( {getLastError:1, w:"anydc", wtimeout:20000} ); -printjson (result) -assert.eq (result.err, null); - -// Insert a document and getLastError with write concern : alldc -db.foo.insert( {x:2} ); -var result = db.runCommand( {getLastError:1, w:"alldc", wtimeout:20000} ); -printjson (result) -assert.eq (result.err, null); +// Insert a document with write concern : anydc +assert.writeOK(db.foo.insert({ x: 1 }, { writeConcern: { w: 'anydc', wtimeout: 20000 }})); +// Insert a document with write concern : alldc +assert.writeOK(db.foo.insert({ x: 2 }, { writeConcern: { w: 'alldc', wtimeout: 20000 }})); // Add a new tag to the replica set var config = master.getDB("local").system.replset.findOne(); @@ -64,17 +57,10 @@ printjson(config); master = replTest.getMaster(); var db = master.getDB("test"); -// Insert a document and getLastError with write concern : anydc -db.foo.insert( {x:3} ); -var result = db.runCommand( {getLastError:1, w:"anydc", wtimeout:20000} ); -printjson (result) -assert.eq (result.err, null); - -// Insert a document and getLastError with write concern : alldc -db.foo.insert( {x:4} ); -var result = db.runCommand( {getLastError:1, w:"alldc", wtimeout:20000} ); -printjson (result) -assert.eq (result.err, null); +// Insert a document with write concern : anydc +assert.writeOK(db.foo.insert({ x: 3 }, { writeConcern: { w: 'anydc', wtimeout: 20000 }})); +// Insert a document with write concern : alldc +assert.writeOK(db.foo.insert({ x: 4 }, { writeConcern: { w: 'alldc', wtimeout: 20000 }})); replTest.stopSet(); |