summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuayu Ouyang <huayu.ouyang@mongodb.com>2022-04-04 14:34:08 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-04 15:14:24 +0000
commit797daddf5dac8aa111f488d4102e1b88d49e56e3 (patch)
treea1cfcc158abaebfc7bf84b57ff4b37be160e6bc9
parent02393f1c3f5be3465919597c890b3249ea2cc18e (diff)
downloadmongo-797daddf5dac8aa111f488d4102e1b88d49e56e3.tar.gz
SERVER-65182 Fix split_horizon_hostname_startup.js to use an assert.soon when getting the replsetconfig
-rw-r--r--jstests/replsets/split_horizon_hostname_startup.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/jstests/replsets/split_horizon_hostname_startup.js b/jstests/replsets/split_horizon_hostname_startup.js
index 235f0e3add6..afeaba2da4e 100644
--- a/jstests/replsets/split_horizon_hostname_startup.js
+++ b/jstests/replsets/split_horizon_hostname_startup.js
@@ -48,7 +48,11 @@ startupConfig.port = mongod.port;
mongod = MongoRunner.runMongod(startupConfig);
assert(mongod);
-let rsConfig2 = mongod.adminCommand({replSetGetConfig: 1});
+let rsConfig2;
+assert.soon(() => {
+ rsConfig2 = mongod.adminCommand({replSetGetConfig: 1});
+ return rsConfig2.ok;
+}, "Failed to get replset config from node");
jsTestLog("rsConfig2: " + tojson(rsConfig2));
assert.commandWorked(rsConfig2);
assert.eq(tojson(rsConfig2.config.members), tojson(rsConfig1.config.members));