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() {
136
136
} else {
137
137
assertEquals (1 , c .find (new BasicDBObject ("i" , 1 )).hint ( "x_1" ).count ());
138
138
}
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
+ }
140
144
}
141
145
142
146
@ Test
@@ -387,7 +391,11 @@ public void testBig() {
387
391
388
392
// negative limit works like negative batch size, for legacy reason
389
393
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
+ }
391
399
392
400
DBCursor a = c .find ();
393
401
assertEquals (numToInsert , a .itcount ());
You can’t perform that action at this time.
0 commit comments