diff options
author | Ali Mir <ali.mir@mongodb.com> | 2020-07-20 18:00:20 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-08-03 22:10:55 +0000 |
commit | 77e2cd03f0c8768dd7e21ac9c3f831c7f74a1749 (patch) | |
tree | ee0f300f1b5e60ef597c7c36e5818c6288f3b886 /src/mongo/shell/servers.js | |
parent | b08444271513a131cdb204379a12e4bf6c99d8be (diff) | |
download | mongo-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.js | 7 |
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); |