Skip to content

Commit c671fa1

Browse files
User provided test; fails on mongos possibly
1 parent 82d796d commit c671fa1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/test/com/mongodb/DBCursorTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,20 @@ public void testBatchWithLimit(){
210210
assertEquals( 50 , c.find().batchSize( 5 ).limit(50).itcount() );
211211
}
212212

213+
@Test
214+
public void testLargeBatch(){
215+
DBCollection c = _db.getCollection( "largeBatch1" );
216+
c.drop();
217+
218+
int total = 1000000;
219+
int batch = 100000;
220+
for ( int i=0; i<total; i++ )
221+
c.save( new BasicDBObject( "x" , i ) );
222+
223+
DBCursor cursor = c.find().batchSize( batch );
224+
assertEquals( total , cursor.itcount() );
225+
assertEquals( total/batch + 1, cursor.getSizes().size());
226+
}
213227
@Test
214228
public void testSpecial(){
215229
DBCollection c = _db.getCollection( "testSpecial" );

0 commit comments

Comments
 (0)