0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-17723 Change explain_read_pref.js to use an existing database

This commit is contained in:
Kaloian Manassiev 2015-04-07 12:57:24 -04:00
parent 41392d9921
commit 04a120d6dc

View File

@ -6,8 +6,6 @@
load("jstests/replsets/rslib.js");
var NODE_COUNT = 2;
var testAllModes = function(conn, isMongos) {
// The primary is tagged with { tag: 'one' } and the secondary with
@ -40,7 +38,7 @@ var testAllModes = function(conn, isMongos) {
].forEach(function(args) {
var mode = args[0], tagSets = args[1], secExpected = args[2];
var testDB = conn.getDB('test');
var testDB = conn.getDB('TestDB');
conn.setSlaveOk(false); // purely rely on readPref
jsTest.log('Testing mode: ' + mode + ', tag sets: ' + tojson(tagSets));
@ -69,7 +67,7 @@ var testAllModes = function(conn, isMongos) {
});
};
var st = new ShardingTest({ shards: { rs0: { nodes: NODE_COUNT }}});
var st = new ShardingTest({ shards: { rs0: { nodes: 2 }}});
st.stopBalancer();
ReplSetTest.awaitRSClientHosts(st.s, st.rs0.nodes);
@ -103,10 +101,10 @@ catch(e) {
st.rs0.awaitSecondaryNodes();
// Force mongos to reconnect after our reconfig
// Force mongos to reconnect after our reconfig and also create the test database
assert.soon(function() {
try {
st.s.getDB('foo').runCommand({ create: 'foo' });
st.s.getDB('TestDB').runCommand({ create: 'TestColl' });
return true;
}
catch (x) {