diff options
-rw-r--r-- | jstests/replsets/remove1.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/jstests/replsets/remove1.js b/jstests/replsets/remove1.js index a1bbc75b99d..9138160784d 100644 --- a/jstests/replsets/remove1.js +++ b/jstests/replsets/remove1.js @@ -38,8 +38,21 @@ catch(e) { print(e); } -assert.throws(replTest.nodes[1].getDB("admin").runCommand({ping:1}).ok, 1, "we are not connected to node[1]"); -assert.eq(replTest.nodes[1].getDB("admin").runCommand({ping:1}).ok, 1, "we are connected to node[1]"); +// This test that nodes[1] disconnects us when it picks up the new config +assert.soon( + function() { + try { + replTest.nodes[1].getDB("admin").runCommand({ping:1}); + } catch (e) { + return true; + } + return false; + } +); + +// Now we should successfully reconnect to nodes[1] +assert.eq(replTest.nodes[1].getDB("admin").runCommand({ping:1}).ok, 1, + "we are connected to node[1]"); reconnect(master); |