summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-08-06 13:24:59 -0400
committerEliot Horowitz <eliot@10gen.com>2010-08-06 13:25:52 -0400
commit3cc86177ceaa37aaeb1e2680194639842c8f81c1 (patch)
treec1cbf155041e4aa4caa10d4ff3ad7374cffae5fe /jstests
parentdcfab78c4b797995c01f4ac4208a882cb9539cc4 (diff)
downloadmongo-3cc86177ceaa37aaeb1e2680194639842c8f81c1.tar.gz
fix getMore with sharding+rs in edge case SERVER-1584
Diffstat (limited to 'jstests')
-rw-r--r--jstests/slowNightly/sharding_rs1.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/jstests/slowNightly/sharding_rs1.js b/jstests/slowNightly/sharding_rs1.js
index 3769e32f432..146895342bc 100644
--- a/jstests/slowNightly/sharding_rs1.js
+++ b/jstests/slowNightly/sharding_rs1.js
@@ -15,7 +15,7 @@ while ( bigString.length < 10000 )
inserted = 0;
num = 0;
while ( inserted < ( 20 * 1024 * 1024 ) ){
- db.foo.insert( { _id : num++ , s : bigString } );
+ db.foo.insert( { _id : num++ , s : bigString , x : Math.random() } );
inserted += bigString.length;
}
@@ -58,4 +58,13 @@ for ( i=0; i<s._rs.length; i++ ){
assert.eq( x.master.md5 , x.slaves[j].md5 , "hashes same for: " + r.url + " slave: " + j );
}
+assert.eq( num , db.foo.find().count() , "C1" )
+assert.eq( num , db.foo.find().itcount() , "C2" )
+assert.eq( num , db.foo.find().sort( { _id : 1 } ).itcount() , "C3" )
+assert.eq( num , db.foo.find().sort( { _id : -1 } ).itcount() , "C4" )
+db.foo.ensureIndex( { x : 1 } )
+assert.eq( num , db.foo.find().sort( { x : 1 } ).itcount() , "C5" )
+assert.eq( num , db.foo.find().sort( { x : -1 } ).itcount() , "C6" )
+
+
s.stop()