summaryrefslogtreecommitdiff
path: root/jstests/replsets/stepdown3.js
diff options
context:
space:
mode:
authorMatthew Russotto <matthew.russotto@10gen.com>2019-02-04 17:57:00 -0500
committerMatthew Russotto <matthew.russotto@10gen.com>2019-02-12 11:07:46 -0500
commitc3a72d61dc8ab4aa32fae400c74b06360a572537 (patch)
tree644f7b08bafd1e3d8e0a7ca856093c50c97ed3ff /jstests/replsets/stepdown3.js
parent530a26bc5387de3dd131a18801a6c3253c4f3220 (diff)
downloadmongo-c3a72d61dc8ab4aa32fae400c74b06360a572537.tar.gz
SERVER-38516 Remove “closeConnectionsOnStepdown” flag and fix tests broken by this
Diffstat (limited to 'jstests/replsets/stepdown3.js')
-rw-r--r--jstests/replsets/stepdown3.js21
1 files changed, 6 insertions, 15 deletions
diff --git a/jstests/replsets/stepdown3.js b/jstests/replsets/stepdown3.js
index d125d7664f1..f40caabe242 100644
--- a/jstests/replsets/stepdown3.js
+++ b/jstests/replsets/stepdown3.js
@@ -32,26 +32,17 @@
// step down the primary asyncronously
print("stepdown");
- var command = "sleep(4000); tojson(db.adminCommand( { replSetStepDown : 60, force : 1 } ));";
+ var command =
+ "sleep(4000); assert.commandWorked(db.adminCommand( { replSetStepDown : 60, force : 1 } ));";
var awaitShell = startParallelShell(command, master.port);
- print("getlasterror; should assert or return an error, depending on timing");
- var gleFunction = function() {
- var result =
- master.getDB("test").runCommand({getLastError: 1, w: 2, wtimeout: 10 * 60 * 1000});
- if (result.errmsg === "not master" || result.code == ErrorCodes.NotMaster ||
- result.code == ErrorCodes.InterruptedDueToStepDown) {
- throw new Error("satisfy assert.throws()");
- }
- print("failed to throw exception; GLE returned: ");
- printjson(result);
- };
- var result = assert.throws(gleFunction);
+ print("getlasterror; should return an error");
+ let result = master.getDB("test").runCommand({getLastError: 1, w: 2, wtimeout: 10 * 60 * 1000});
+ assert(ErrorCodes.isNotMasterError(result.code));
print("result of gle:");
printjson(result);
- var exitCode = awaitShell({checkExitSuccess: false});
- assert.neq(0, exitCode, "expected replSetStepDown to close the shell's connection");
+ awaitShell();
// unlock and shut down
printjson(locked.getDB("admin").fsyncUnlock());