From 797daddf5dac8aa111f488d4102e1b88d49e56e3 Mon Sep 17 00:00:00 2001 From: Huayu Ouyang Date: Mon, 4 Apr 2022 14:34:08 +0000 Subject: SERVER-65182 Fix split_horizon_hostname_startup.js to use an assert.soon when getting the replsetconfig --- jstests/replsets/split_horizon_hostname_startup.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)); -- cgit v1.2.1