summaryrefslogtreecommitdiff
path: root/jstests/splitvector.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2012-03-22 01:14:27 -0400
committerEliot Horowitz <eliot@10gen.com>2012-03-22 01:14:27 -0400
commitd691ad27067d08a8b708cf716cc302c5f629c0f2 (patch)
tree6ab57e439675ced2a9c066192183ef3015c7c9aa /jstests/splitvector.js
parent03b3123b8b2f0aacaca29cd121807da9f50e8904 (diff)
downloadmongo-d691ad27067d08a8b708cf716cc302c5f629c0f2.tar.gz
fix sharded splitvector test and make error message better
Diffstat (limited to 'jstests/splitvector.js')
-rw-r--r--jstests/splitvector.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/jstests/splitvector.js b/jstests/splitvector.js
index c58cda0de03..022f0701908 100644
--- a/jstests/splitvector.js
+++ b/jstests/splitvector.js
@@ -185,18 +185,22 @@ f.save( { x: 2 } );
f.save( { x: 3 } );
db.getLastError();
-res = db.runCommand( { splitVector: "test.jstests_splitvector" , keyPattern: {x:1} , force : true } );
-
-assert.eq( true , res.ok , "9a" );
-assert.eq( 1 , res.splitKeys.length , "9b" );
-assert.eq( 2 , res.splitKeys[0].x , "9c" );
+assert.eq( 3 , f.count() );
+print( f.getFullName() )
-
-res = db.adminCommand( { splitVector: "test.jstests_splitvector" , keyPattern: {x:1} , force : true } );
+res = db.runCommand( { splitVector: f.getFullName() , keyPattern: {x:1} , force : true } );
assert.eq( true , res.ok , "9a" );
assert.eq( 1 , res.splitKeys.length , "9b" );
assert.eq( 2 , res.splitKeys[0].x , "9c" );
+if ( db.runCommand( "isMaster" ).msg != "isdbgrid" ) {
+ res = db.adminCommand( { splitVector: "test.jstests_splitvector" , keyPattern: {x:1} , force : true } );
+
+ assert.eq( true , res.ok , "9a: " + tojson(res) );
+ assert.eq( 1 , res.splitKeys.length , "9b: " + tojson(res) );
+ assert.eq( 2 , res.splitKeys[0].x , "9c: " + tojson(res) );
+}
+
print("PASSED");