summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/max_bson_depth_parameter.js
diff options
context:
space:
mode:
authorSpencer Jackson <spencer.jackson@mongodb.com>2021-06-10 22:01:42 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-06-23 17:51:07 +0000
commit09f99b41e373768c5c1645d15733d1148b891176 (patch)
treefd72d76c2a04a23f0705a2ccfa23ceb8dbeacbef /jstests/noPassthrough/max_bson_depth_parameter.js
parent913ced248f4f4a5518dc4079bf17d14fe12f236b (diff)
downloadmongo-09f99b41e373768c5c1645d15733d1148b891176.tar.gz
SERVER-53062 Throw an exception in tests if server startup fails
Diffstat (limited to 'jstests/noPassthrough/max_bson_depth_parameter.js')
-rw-r--r--jstests/noPassthrough/max_bson_depth_parameter.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/jstests/noPassthrough/max_bson_depth_parameter.js b/jstests/noPassthrough/max_bson_depth_parameter.js
index 3aef0995d34..8914dd2bd1b 100644
--- a/jstests/noPassthrough/max_bson_depth_parameter.js
+++ b/jstests/noPassthrough/max_bson_depth_parameter.js
@@ -45,9 +45,12 @@ assert.commandFailedWithCode(
// Restart mongod with a negative maximum BSON depth and test that it fails to start.
MongoRunner.stopMongod(conn);
-conn = MongoRunner.runMongod({setParameter: "maxBSONDepth=-4"});
-assert.eq(null, conn, "Expected mongod to fail at startup because depth was negative");
-conn = MongoRunner.runMongod({setParameter: "maxBSONDepth=1"});
-assert.eq(null, conn, "Expected mongod to fail at startup because depth was too low");
+assert.throws(() => MongoRunner.runMongod({setParameter: "maxBSONDepth=-4"}),
+ [],
+ "Expected mongod to fail at startup because depth was negative");
+
+assert.throws(() => MongoRunner.runMongod({setParameter: "maxBSONDepth=1"}),
+ [],
+ "Expected mongod to fail at startup because depth was too low");
}());