From 04a120d6dc50d6bb1fd5073ea28a6c8ddc07fecd Mon Sep 17 00:00:00 2001 From: Kaloian Manassiev Date: Tue, 7 Apr 2015 12:57:24 -0400 Subject: [PATCH] SERVER-17723 Change explain_read_pref.js to use an existing database --- jstests/sharding/explain_read_pref.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/jstests/sharding/explain_read_pref.js b/jstests/sharding/explain_read_pref.js index 89a5e24a99c..595cc331958 100644 --- a/jstests/sharding/explain_read_pref.js +++ b/jstests/sharding/explain_read_pref.js @@ -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) {