summaryrefslogtreecommitdiff
path: root/src/mongo/shell
diff options
context:
space:
mode:
authorMoustafa Maher <m.maher@10gen.com>2021-07-09 19:10:29 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-08-04 19:22:33 +0000
commit29f2d199372149656d3cd1137bdcf7c582656371 (patch)
tree47c1a69fe6239750cb768e4bae551172417c87b3 /src/mongo/shell
parent940c7765a4abd748459225a91e045856a7e4607d (diff)
downloadmongo-29f2d199372149656d3cd1137bdcf7c582656371.tar.gz
SERVER-56844 Fassert shard server on startup if DWCF=w:1 and no CWWC set
Diffstat (limited to 'src/mongo/shell')
-rw-r--r--src/mongo/shell/replsettest.js2
-rw-r--r--src/mongo/shell/servers.js3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js
index 16f194470a8..905346b8ff3 100644
--- a/src/mongo/shell/replsettest.js
+++ b/src/mongo/shell/replsettest.js
@@ -3193,7 +3193,7 @@ var ReplSetTest = function(opts) {
let port = parseInt(conn.port);
print("ReplSetTest stopSet waiting for mongo program on port " + port + " to stop.");
let exitCode = waitMongoProgram(port);
- if (exitCode !== MongoRunner.EXIT_CLEAN) {
+ if (exitCode !== MongoRunner.EXIT_CLEAN && !opts.skipValidatingExitCode) {
throw new Error("ReplSetTest stopSet mongo program on port " + port +
" shut down unexpectedly with code " + exitCode + " when code " +
MongoRunner.EXIT_CLEAN + " was expected.");
diff --git a/src/mongo/shell/servers.js b/src/mongo/shell/servers.js
index fac40989772..1d8b818e3b3 100644
--- a/src/mongo/shell/servers.js
+++ b/src/mongo/shell/servers.js
@@ -1029,6 +1029,7 @@ MongoRunner.validateCollectionsCallback = function(port) {};
* pwd {string}: admin password
* },
* skipValidation: <bool>,
+ * skipValidatingExitCode: <bool>,
* allowedExitCode: <int>
* }
* @param {boolean} waitpid should we wait for the process to terminate after stopping it.
@@ -1092,7 +1093,7 @@ var stopMongoProgram = function(conn, signal, opts, waitpid) {
if (!waitpid) {
returnCode = 0;
}
- if (allowedExitCode !== returnCode) {
+ if (allowedExitCode !== returnCode && !opts.skipValidatingExitCode) {
throw new MongoRunner.StopError(returnCode);
} else if (returnCode !== MongoRunner.EXIT_CLEAN) {
print("MongoDB process on port " + port + " intentionally exited with error code ",