diff options
author | Judah Schvimer <judah@mongodb.com> | 2017-05-22 10:53:17 -0400 |
---|---|---|
committer | Judah Schvimer <judah@mongodb.com> | 2017-05-22 10:53:17 -0400 |
commit | aa796e3a1e2bce7ec6af0b6d15ecff0ae3c102a3 (patch) | |
tree | 9b0d73667a2dc3ab8d3248018f1988d8bf3a1386 | |
parent | d918f77b19767ce405db0641a5c65f3e66c26035 (diff) | |
download | mongo-aa796e3a1e2bce7ec6af0b6d15ecff0ae3c102a3.tar.gz |
SERVER-22582 Wrap assert.soon bodies in try catch in replsettest.js
-rw-r--r-- | src/mongo/shell/replsettest.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js index 040fa531021..723127608e6 100644 --- a/src/mongo/shell/replsettest.js +++ b/src/mongo/shell/replsettest.js @@ -181,7 +181,7 @@ var ReplSetTest = function(opts) { var currTime = new Date().getTime(); var status; - assert.soon(function() { + assert.soonNoExcept(function() { try { var conn = _callIsMaster(); if (!conn) { @@ -405,7 +405,7 @@ var ReplSetTest = function(opts) { this.awaitSecondaryNodes = function(timeout) { timeout = timeout || self.kDefaultTimeoutMS; - assert.soon(function() { + assert.soonNoExcept(function() { // Reload who the current slaves are self.getPrimary(timeout); @@ -494,7 +494,7 @@ var ReplSetTest = function(opts) { timeout = timeout || self.kDefaultTimeoutMS; var primary = null; - assert.soon(function() { + assert.soonNoExcept(function() { primary = _callIsMaster(); return primary; }, "Finding primary", timeout); @@ -506,7 +506,7 @@ var ReplSetTest = function(opts) { msg = msg || "Timed out waiting for there to be no primary in replset: " + this.name; timeout = timeout || self.kDefaultTimeoutMS; - assert.soon(function() { + assert.soonNoExcept(function() { return _callIsMaster() == false; }, msg, timeout); }; @@ -722,7 +722,7 @@ var ReplSetTest = function(opts) { print("Waiting for op with OpTime " + tojson(opTime) + " to be committed on all secondaries"); - assert.soon(function() { + assert.soonNoExcept(function() { for (var i = 0; i < rst.nodes.length; i++) { var node = rst.nodes[i]; @@ -763,7 +763,7 @@ var ReplSetTest = function(opts) { // Blocking call, which will wait for the last optime written on the master to be available var awaitLastOpTimeWrittenFn = function() { var master = self.getPrimary(); - assert.soon(function() { + assert.soonNoExcept(function() { try { masterLatestOpTime = _getLastOpTime(master); } catch (e) { @@ -800,7 +800,7 @@ var ReplSetTest = function(opts) { ", is " + tojson(masterLatestOpTime) + ", last oplog entry is " + tojsononeline(masterOpTime)); - assert.soon(function() { + assert.soonNoExcept(function() { try { print("ReplSetTest awaitReplication: checking secondaries against timestamp " + tojson(masterLatestOpTime)); @@ -1235,7 +1235,7 @@ var ReplSetTest = function(opts) { */ this.waitForMaster = function(timeout) { var master; - assert.soon(function() { + assert.soonNoExcept(function() { return (master = self.getPrimary()); }, "waiting for master", timeout); @@ -1369,7 +1369,7 @@ ReplSetTest.awaitRSClientHosts = function(conn, host, hostOk, rs, timeout) { var tests = 0; - assert.soon(function() { + assert.soonNoExcept(function() { var rsClientHosts = conn.adminCommand('connPoolStats').replicaSets; if (tests++ % 10 == 0) { printjson(rsClientHosts); |