File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,11 @@ public void testCountAndHint() {
136136 } else {
137137 assertEquals (1 , c .find (new BasicDBObject ("i" , 1 )).hint ( "x_1" ).count ());
138138 }
139- assertEquals ( 2 , collection .find ().hint ( "x_1" ).count ());
139+ if (serverIsAtLeastVersion (3.3 )) {
140+ assertEquals (0 , collection .find ().hint ("x_1" ).count ()); // see https://jira.mongodb.org/browse/SERVER-22041
141+ } else {
142+ assertEquals (2 , collection .find ().hint ("x_1" ).count ());
143+ }
140144 }
141145
142146 @ Test
@@ -387,7 +391,11 @@ public void testBig() {
387391
388392 // negative limit works like negative batch size, for legacy reason
389393 int x = c .find ().limit (-800 ).toArray ().size ();
390- assertTrue (x < 800 );
394+ if (serverIsAtLeastVersion (3.3 )) {
395+ assertEquals (800 , x ); // MongoDB 3.4 creates a 12MB OP_REPLY that fits all 800 documents
396+ } else {
397+ assertTrue (x < 800 ); // Previous versions cut off the OP_REPLY at 4MB
398+ }
391399
392400 DBCursor a = c .find ();
393401 assertEquals (numToInsert , a .itcount ());
You can’t perform that action at this time.
0 commit comments