Skip to content

Commit aacd231

Browse files
author
matt dannenberg
committed
SERVER-22120 rework bad nested assert.soon()s in no_chaining.js
1 parent cc24abf commit aacd231

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

jstests/replsets/no_chaining.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,19 @@ var checkNoChaining = function() {
4646
};
4747

4848
var forceSync = function() {
49+
var config;
50+
try {
51+
config = nodes[2].getDB("local").system.replset.findOne();
52+
} catch (e) {
53+
config = nodes[2].getDB("local").system.replset.findOne();
54+
}
55+
var targetHost = config.members[1].host;
56+
printjson(nodes[2].getDB("admin").runCommand({replSetSyncFrom : targetHost}));
4957
assert.soon(
5058
function() {
51-
var config = nodes[2].getDB("local").system.replset.findOne();
52-
var targetHost = config.members[1].host;
53-
printjson(nodes[2].getDB("admin").runCommand({replSetSyncFrom : targetHost}));
54-
assert.soon(
55-
function() {
56-
return nodes[2].getDB("test").foo.findOne() != null;
57-
},
58-
'Check for data after force sync', 5000
59-
);
6059
return nodes[2].getDB("test").foo.findOne() != null;
6160
},
62-
'Check force sync still works'
61+
'Check for data after force sync'
6362
);
6463
};
6564

0 commit comments

Comments
 (0)