summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTad Marshall <tad@10gen.com>2013-03-02 08:51:46 -0500
committerTad Marshall <tad@10gen.com>2013-03-02 08:51:46 -0500
commitc8fea053358994f98cd8e4112ae90e90ce207d9a (patch)
tree20cb2105d4a4fd507dc84e68b91b78ffafae99aa
parent11188a46354c7a46761fdcb3e2cdb4bc589f03e8 (diff)
downloadmongo-c8fea053358994f98cd8e4112ae90e90ce207d9a.tar.gz
SERVER-8814 SERVER-8802 Do not change 'db' in test
Do not change the 'db' variable in indexOtherNamespace.js. When run as part of sharding_passthrough.js, this breaks downstream tests (rename.js was one).
-rw-r--r--jstests/indexOtherNamespace.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/jstests/indexOtherNamespace.js b/jstests/indexOtherNamespace.js
index 9410e281347..5bb7355ddb6 100644
--- a/jstests/indexOtherNamespace.js
+++ b/jstests/indexOtherNamespace.js
@@ -5,16 +5,17 @@ function assertGLENotOK(status) {
"Expected not-OK status object; found " + tojson(status));
}
-db = db.getSiblingDB("indexOtherNS");
-db.dropDatabase();
+var otherDB = db.getSiblingDB("indexOtherNS");
+otherDB.dropDatabase();
-db.foo.insert({a:1})
-assert.eq(1, db.system.indexes.count());
-assert.eq("BasicCursor", db.foo.find({a:1}).explain().cursor);
+otherDB.foo.insert({a:1})
+assert.eq(1, otherDB.system.indexes.count());
+assert.eq("BasicCursor", otherDB.foo.find({a:1}).explain().cursor);
-db.randomNS.system.indexes.insert({ns:"indexOtherNS.foo", key:{a:1}, name:"a_1"});
-assertGLENotOK(db.getLastErrorObj());
+otherDB.randomNS.system.indexes.insert({ns:"indexOtherNS.foo", key:{a:1}, name:"a_1"});
+assertGLENotOK(otherDB.getLastErrorObj());
// Assert that index didn't actually get built
-assert.eq(1, db.system.indexes.count());
-assert.eq(null, db.system.namespaces.findOne({name : "indexOtherNS.foo.$a_1"}));
-assert.eq("BasicCursor", db.foo.find({a:1}).explain().cursor);
+assert.eq(1, otherDB.system.indexes.count());
+assert.eq(null, otherDB.system.namespaces.findOne({name : "indexOtherNS.foo.$a_1"}));
+assert.eq("BasicCursor", otherDB.foo.find({a:1}).explain().cursor);
+otherDB.dropDatabase();