summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristina <kristina@10gen.com>2013-02-22 15:48:24 -0500
committerKristina <kristina@10gen.com>2013-02-22 15:48:24 -0500
commitb4be8b421a39444f7ffb45f232db40dbd945823b (patch)
tree80d7d9336a2782192341a9006538ac559fcc5732
parent4cdf08b86b2f9141f0dc9e5a878a9a853364efd3 (diff)
downloadmongo-b4be8b421a39444f7ffb45f232db40dbd945823b.tar.gz
SERVER-8677 Remove race condition in test
-rw-r--r--jstests/replsets/remove1.js17
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);