summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Guo <robert.guo@10gen.com>2018-04-26 13:59:14 -0400
committerRobert Guo <robert.guo@10gen.com>2018-04-30 09:56:57 -0400
commit0b04f8bab03c64477b6ffd60fcd1c592dd4ca2b1 (patch)
tree69089748507d850703566f526168f4502a2224bb
parent1f68e5807f34985a8d1abcb41acd6b3666ef8d13 (diff)
downloadmongo-0b04f8bab03c64477b6ffd60fcd1c592dd4ca2b1.tar.gz
SERVER-34693 add exit code check in oplog_replay_on_startup.js
-rw-r--r--jstests/replsets/oplog_replay_on_startup.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/jstests/replsets/oplog_replay_on_startup.js b/jstests/replsets/oplog_replay_on_startup.js
index bac823ee3e5..c304986e79f 100644
--- a/jstests/replsets/oplog_replay_on_startup.js
+++ b/jstests/replsets/oplog_replay_on_startup.js
@@ -103,11 +103,17 @@
injectedOplogTruncateAfterPointDoc,
"If the Timestamps differ, the server may be filling in the null timestamps");
- try {
- conn = rst.restart(0); // Restart in replSet mode again.
- } catch (e) {
- assert.eq(expectedState, 'FATAL', 'node failed to restart: ' + e);
+ rst.stop(0);
+
+ if (expectedState === 'FATAL') {
+ try {
+ rst.start(0, {waitForConnect: true}, true);
+ } catch (e) {
+ }
+ rst.stop(0, undefined, {allowedExitCode: MongoRunner.EXIT_ABRUPT});
return;
+ } else {
+ conn = rst.start(0, {waitForConnect: true}, true);
}
// Wait for the node to go to SECONDARY if it is able.