diff options
author | Spencer Jackson <spencer.jackson@mongodb.com> | 2021-06-10 22:01:42 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-06-23 17:51:07 +0000 |
commit | 09f99b41e373768c5c1645d15733d1148b891176 (patch) | |
tree | fd72d76c2a04a23f0705a2ccfa23ceb8dbeacbef /jstests/noPassthrough/max_bson_depth_parameter.js | |
parent | 913ced248f4f4a5518dc4079bf17d14fe12f236b (diff) | |
download | mongo-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.js | 11 |
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"); }()); |