summaryrefslogtreecommitdiff
path: root/jstests/gle
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2014-11-21 17:15:38 -0500
committerAndy Schwerin <schwerin@mongodb.com>2014-12-02 11:42:28 -0500
commitf51e0f461f903b1ecb014c7ad796374933e12c60 (patch)
treee304340651fb9d3f51ee9d81c0c658a1b3f95c23 /jstests/gle
parent6c22ffb8d92dd795ff22e887b13797c36e86dc72 (diff)
downloadmongo-f51e0f461f903b1ecb014c7ad796374933e12c60.tar.gz
SERVER-16376 Make nodes in jstests/gle/get_last_error.js choose their sync source deterministically.
The test expects w:majority writes to happen faster than a heartbeat interval when a single non-primary node fails. If, however, that failed node is the intermediate in a replication chain, there can be a multi-second lag until the other nodes recognize the failure. Change the test to disallow chaining, because it is not the subject of the test.
Diffstat (limited to 'jstests/gle')
-rw-r--r--jstests/gle/get_last_error.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/jstests/gle/get_last_error.js b/jstests/gle/get_last_error.js
index e902aaecaba..c97c6da0b56 100644
--- a/jstests/gle/get_last_error.js
+++ b/jstests/gle/get_last_error.js
@@ -1,8 +1,17 @@
// Check that the wtime and writtenTo fields are set or unset depending on the writeConcern used.
// First check on a replica set with different combinations of writeConcern
-var replTest = new ReplSetTest( {name: "SERVER-9005", oplogSize: 1, nodes: 3} );
+var name = "SERVER-9005";
+var replTest = new ReplSetTest( {name: name, oplogSize: 1, nodes: 3} );
var nodes = replTest.startSet();
-replTest.initiate();
+replTest.initiate({
+ _id: name,
+ members: [
+ { _id: 0, host: replTest.nodeList()[0] },
+ { _id: 1, host: replTest.nodeList()[1] },
+ { _id: 2, host: replTest.nodeList()[2] }
+ ],
+ settings: { chainingAllowed: false }
+});
var master = replTest.getMaster();
var mdb = master.getDB("test");