summaryrefslogtreecommitdiff
path: root/jstests/sharding/read_pref_cmd.js
diff options
context:
space:
mode:
authormatt dannenberg <matt.dannenberg@10gen.com>2013-09-17 14:52:04 -0400
committermatt dannenberg <matt.dannenberg@10gen.com>2013-09-18 15:13:56 -0400
commitde25d5b966fae434669df47b41c076445d2303f6 (patch)
tree787110b1fd875aa27dcdbcc3518006cce4442d43 /jstests/sharding/read_pref_cmd.js
parentc69859f9e723f7c7930729930b688d392157a596 (diff)
downloadmongo-de25d5b966fae434669df47b41c076445d2303f6.tar.gz
SERVER-7533 added an _awaitRSHostViaRSMonitor method based on _replMonitorStats
updated jstests/sharding/read_pref_cmd.js to use this new method
Diffstat (limited to 'jstests/sharding/read_pref_cmd.js')
-rw-r--r--jstests/sharding/read_pref_cmd.js26
1 files changed, 6 insertions, 20 deletions
diff --git a/jstests/sharding/read_pref_cmd.js b/jstests/sharding/read_pref_cmd.js
index d36dcca9abc..f9b0ea5f304 100644
--- a/jstests/sharding/read_pref_cmd.js
+++ b/jstests/sharding/read_pref_cmd.js
@@ -1,4 +1,3 @@
-if (0) { // SERVER-10429, SERVER-7533
load("jstests/replsets/rslib.js");
var NODE_COUNT = 2;
@@ -320,28 +319,15 @@ jsTest.log('got rsconf ' + tojson(rsConfig));
var replConn = new Mongo(st.rs0.getURL());
-// TODO: use api in SERVER-7533 once available.
-// Make sure replica set connection is ready by repeatedly performing a dummy query
-// against the secondary until it succeeds. This hack is needed because awaitRSClientHosts
-// won't work on the shell's instance of the ReplicaSetMonitor.
-assert.soon(function() {
- try {
- replConn.getDB('test').user.find().readPref('secondary').hasNext();
- return true;
- }
- catch (x) {
- // Intentionally caused an error that forces the monitor to refresh.
- print('Caught exception while doing dummy query: ' + tojson(x));
- return false;
- }
-});
+// Make sure replica set connection is ready
+_awaitRSHostViaRSMonitor(st.rs0.nodeList()[0], {ok: true}, "test-rs0");
+_awaitRSHostViaRSMonitor(st.rs0.nodeList()[1], {ok: true}, "test-rs0");
-testAllModes(replConn, st.rs0.nodes, false);
+//TODO: fix and reenable the testAllModes portions of this test
+//testAllModes(replConn, st.rs0.nodes, false);
jsTest.log('Starting test for mongos connection');
-testAllModes(st.s, st.rs0.nodes, true);
+//testAllModes(st.s, st.rs0.nodes, true);
st.stop();
-
-}