summaryrefslogtreecommitdiff
path: root/src/mongo/shell/servers.js
diff options
context:
space:
mode:
authorAli Mir <ali.mir@mongodb.com>2020-07-20 18:00:20 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-03 22:10:55 +0000
commit77e2cd03f0c8768dd7e21ac9c3f831c7f74a1749 (patch)
treeee0f300f1b5e60ef597c7c36e5818c6288f3b886 /src/mongo/shell/servers.js
parentb08444271513a131cdb204379a12e4bf6c99d8be (diff)
downloadmongo-77e2cd03f0c8768dd7e21ac9c3f831c7f74a1749.tar.gz
SERVER-48206 Check process exit codes when stopping nodes in replsettest.js
Diffstat (limited to 'src/mongo/shell/servers.js')
-rw-r--r--src/mongo/shell/servers.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mongo/shell/servers.js b/src/mongo/shell/servers.js
index 93f5f4a1c73..8cfb437f365 100644
--- a/src/mongo/shell/servers.js
+++ b/src/mongo/shell/servers.js
@@ -1024,10 +1024,9 @@ var stopMongoProgram = function(conn, signal, opts, waitpid) {
TestData.skipEnforceFastCountOnValidate = true;
}
- var allowedExitCode = MongoRunner.EXIT_CLEAN;
-
- if (opts.allowedExitCode) {
- allowedExitCode = opts.allowedExitCode;
+ const allowedExitCode = opts.allowedExitCode ? opts.allowedExitCode : MongoRunner.EXIT_CLEAN;
+ if (!waitpid && allowedExitCode !== MongoRunner.EXIT_CLEAN) {
+ throw new Error('Must wait for process to exit if it is expected to exit uncleanly');
}
var port = parseInt(conn.port);