diff options
Diffstat (limited to 'jstests/replsets/replset5.js')
-rw-r--r-- | jstests/replsets/replset5.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/jstests/replsets/replset5.js b/jstests/replsets/replset5.js index 717a0c8153b..c0aee6e1154 100644 --- a/jstests/replsets/replset5.js +++ b/jstests/replsets/replset5.js @@ -1,17 +1,20 @@ // rs test getlasterrordefaults load("jstests/replsets/rslib.js"); -(function () { +(function() { "use strict"; // Test write concern defaults - var replTest = new ReplSetTest({ name: 'testSet', nodes: 3 }); + var replTest = new ReplSetTest({name: 'testSet', nodes: 3}); var nodes = replTest.startSet(); // Initiate set with default for write concern var config = replTest.getReplSetConfig(); config.settings = {}; - config.settings.getLastErrorDefaults = { 'w': 3, 'wtimeout': 20000 }; + config.settings.getLastErrorDefaults = { + 'w': 3, + 'wtimeout': 20000 + }; config.settings.heartbeatTimeoutSecs = 15; // Prevent node 2 from becoming primary, as we will attempt to set it to hidden later. config.members[2].priority = 0; @@ -24,18 +27,18 @@ load("jstests/replsets/rslib.js"); var testDB = "foo"; // Initial replication - master.getDB("barDB").bar.save({ a: 1 }); + master.getDB("barDB").bar.save({a: 1}); replTest.awaitReplication(); // These writes should be replicated immediately var docNum = 5000; var bulk = master.getDB(testDB).foo.initializeUnorderedBulkOp(); for (var n = 0; n < docNum; n++) { - bulk.insert({ n: n }); + bulk.insert({n: n}); } // should use the configured last error defaults from above, that's what we're testing. - // + // // If you want to test failure, just add values for w and wtimeout (e.g. w=1) // to the following command. This will override the default set above and // prevent replication from happening in time for the count tests below. |