diff options
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); |