summaryrefslogtreecommitdiff
path: root/jstests/sharding
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/sharding
parent913ced248f4f4a5518dc4079bf17d14fe12f236b (diff)
downloadmongo-09f99b41e373768c5c1645d15733d1148b891176.tar.gz
SERVER-53062 Throw an exception in tests if server startup fails
Diffstat (limited to 'jstests/sharding')
-rw-r--r--jstests/sharding/time_zone_info_mongos.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/jstests/sharding/time_zone_info_mongos.js b/jstests/sharding/time_zone_info_mongos.js
index df2bcc89214..8851297628a 100644
--- a/jstests/sharding/time_zone_info_mongos.js
+++ b/jstests/sharding/time_zone_info_mongos.js
@@ -24,13 +24,17 @@ function testWithGoodTimeZoneDir(tzGoodInfoDir) {
assert.eq(mongosCfg.parsed.processManagement.timeZoneInfo, tzGoodInfoDir);
// Test that a bad timezone file causes mongoS startup to fail.
- let conn = MongoRunner.runMongos({configdb: st.configRS.getURL(), timeZoneInfo: tzBadInfo});
- assert.eq(conn, null, "expected launching mongos with bad timezone rules to fail");
+ assert.throws(
+ () => MongoRunner.runMongos({configdb: st.configRS.getURL(), timeZoneInfo: tzBadInfo}),
+ [],
+ "expected launching mongos with bad timezone rules to fail");
assert.neq(-1, rawMongoProgramOutput().search(/Fatal assertion.*40475/));
// Test that a non-existent timezone directory causes mongoS startup to fail.
- conn = MongoRunner.runMongos({configdb: st.configRS.getURL(), timeZoneInfo: tzNoInfo});
- assert.eq(conn, null, "expected launching mongos with bad timezone rules to fail");
+ assert.throws(
+ () => MongoRunner.runMongos({configdb: st.configRS.getURL(), timeZoneInfo: tzNoInfo}),
+ [],
+ "expected launching mongos with bad timezone rules to fail");
// Look for either old or new error message
assert(rawMongoProgramOutput().includes("Error creating service context") ||
rawMongoProgramOutput().includes("Failed to create service context"));