diff options
author | Scott Hernandez <scotthernandez@gmail.com> | 2015-10-22 14:23:00 -0400 |
---|---|---|
committer | Scott Hernandez <scotthernandez@gmail.com> | 2015-10-23 13:45:07 -0400 |
commit | c155fe777a85c50a1c61f3aab87ecd65b0b944dd (patch) | |
tree | 485317eba7aa079765ab0a5bec12ea513094cbc1 /jstests/replsets/read_after_optime.js | |
parent | f3e6dadf23a81fa396a96e33b0fc6e5aedd3fe51 (diff) | |
download | mongo-c155fe777a85c50a1c61f3aab87ecd65b0b944dd.tar.gz |
increase election timeout for drain.js
Diffstat (limited to 'jstests/replsets/read_after_optime.js')
-rw-r--r-- | jstests/replsets/read_after_optime.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/jstests/replsets/read_after_optime.js b/jstests/replsets/read_after_optime.js index 4e457361326..431170c28f2 100644 --- a/jstests/replsets/read_after_optime.js +++ b/jstests/replsets/read_after_optime.js @@ -8,6 +8,7 @@ replTest.startSet(); var config = replTest.getReplSetConfig(); replTest.initiate(config); +config = replTest.getConfigFromPrimary(); var runTest = function(testDB, primaryConn) { primaryConn.getDB('test').user.insert({ x: 1 }, { writeConcern: { w: 2 }}); @@ -17,11 +18,8 @@ var runTest = function(testDB, primaryConn) { var oplogTS = localDB.oplog.rs.find().sort({ $natural: -1 }).limit(1).next(); var twoSecTS = new Timestamp(oplogTS.ts.getTime() + 2, 0); - var term; - if (config.protocolVersion === 0) { - term = -1; - } - else { + var term = -1; + if (config.protocolVersion === 1) { term = oplogTS.t; } @@ -35,7 +33,7 @@ var runTest = function(testDB, primaryConn) { maxTimeMS: 1000 })); - assert.eq(50, res.code); // ErrorCodes::ExceededTimeLimit + assert.eq(50, res.code, tojson(res)); // ErrorCodes::ExceededTimeLimit assert.gt(res.waitedMS, 500); assert.lt(res.waitedMS, 2500); |