summaryrefslogtreecommitdiff
path: root/jstests/sharding/shard1.js
diff options
context:
space:
mode:
authorRandolph Tan <ren@Randolphs-MacBook-Air.local>2012-03-01 20:14:51 -0500
committerRandolph <randolph@10gen.com>2012-03-02 08:16:08 -0500
commit372d940d6ec3f645e63c9d9a87541ca0db985b35 (patch)
tree0a2db2d7c9b6ce7eaa7e465d203eb489446f4d39 /jstests/sharding/shard1.js
parent5d065652e1318dcab9ddaf54eaea763f7d8caf6a (diff)
downloadmongo-372d940d6ec3f645e63c9d9a87541ca0db985b35.tar.gz
SERVER-5163 Build failing on shard1.js test
Modified the test to bypass the invalid db name checking from the db shell constructor. Also added a more helpful error message on error.
Diffstat (limited to 'jstests/sharding/shard1.js')
-rw-r--r--jstests/sharding/shard1.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/jstests/sharding/shard1.js b/jstests/sharding/shard1.js
index b7dc572695c..f84ff3bc727 100644
--- a/jstests/sharding/shard1.js
+++ b/jstests/sharding/shard1.js
@@ -35,9 +35,12 @@ assert.eq( si.ns , "test.foo" );
assert.eq( 3 , db.foo.find().length() , "after sharding, no split count failed" );
-// SERVER-4284
-s.getDB( "foo bar" ).blah.insert( { x : 1 } )
-assert.isnull( s.config.databases.findOne( { _id : "foo bar" } ) )
+// SERVER-4284, test modified because of SERVER-5020
+var invalidDB = s.getDB( "foobar" );
+// hack to bypass invalid database name checking at the DB constructor
+invalidDB._name = "foo bar";
+invalidDB.blah.insert( { x : 1 } );
+assert.isnull( s.config.databases.findOne( { _id : "foo bar" } ) );
s.stop();