@@ -77,7 +77,7 @@ describe('CSOT spec prose tests', function () {
77
77
beforeEach ( async function ( ) {
78
78
await internalClient
79
79
. db ( 'db' )
80
- . collection ( 'coll ' )
80
+ . collection ( 'bulkWriteTest ' )
81
81
. drop ( )
82
82
. catch ( ( ) => null ) ;
83
83
await internalClient . db ( 'admin' ) . command ( failpoint ) ;
@@ -93,7 +93,7 @@ describe('CSOT spec prose tests', function () {
93
93
const oneMBDocs = Array . from ( { length : 50 } , ( _ , _id ) => ( { _id, a } ) ) ;
94
94
const error = await client
95
95
. db ( 'db' )
96
- . collection < { _id : number ; a : Uint8Array } > ( 'coll ' )
96
+ . collection < { _id : number ; a : Uint8Array } > ( 'bulkWriteTest ' )
97
97
. insertMany ( oneMBDocs )
98
98
. catch ( error => error ) ;
99
99
@@ -265,6 +265,7 @@ describe('CSOT spec prose tests', function () {
265
265
} ) ;
266
266
267
267
context ( '5. Blocking Iteration Methods' , ( ) => {
268
+ const metadata = { requires : { mongodb : '>=4.4' } } ;
268
269
/**
269
270
* Tests in this section MUST only be run against server versions 4.4 and higher and only apply to drivers that have a
270
271
* blocking method for cursor iteration that executes `getMore` commands in a loop until a document is available or an
@@ -276,7 +277,7 @@ describe('CSOT spec prose tests', function () {
276
277
data : {
277
278
failCommands : [ 'getMore' ] ,
278
279
blockConnection : true ,
279
- blockTimeMS : 20
280
+ blockTimeMS : 90
280
281
}
281
282
} ;
282
283
let internalClient : MongoClient ;
@@ -286,15 +287,25 @@ describe('CSOT spec prose tests', function () {
286
287
287
288
beforeEach ( async function ( ) {
288
289
internalClient = this . configuration . newClient ( ) ;
289
- await internalClient . db ( 'db' ) . dropCollection ( 'coll' ) ;
290
+ await internalClient
291
+ . db ( 'db' )
292
+ . collection ( 'coll' )
293
+ . drop ( )
294
+ . catch ( ( ) => null ) ;
290
295
// Creating capped collection to be able to create tailable find cursor
291
296
const coll = await internalClient
292
297
. db ( 'db' )
293
298
. createCollection ( 'coll' , { capped : true , size : 1_000_000 } ) ;
294
299
await coll . insertOne ( { x : 1 } ) ;
295
300
await internalClient . db ( ) . admin ( ) . command ( failpoint ) ;
296
301
297
- client = this . configuration . newClient ( undefined , { timeoutMS : 20 , monitorCommands : true } ) ;
302
+ client = this . configuration . newClient ( undefined , {
303
+ monitorCommands : true ,
304
+ timeoutMS : 100 ,
305
+ minPoolSize : 20
306
+ } ) ;
307
+ await client . connect ( ) ;
308
+
298
309
commandStarted = [ ] ;
299
310
commandSucceeded = [ ] ;
300
311
@@ -337,11 +348,11 @@ describe('CSOT spec prose tests', function () {
337
348
* 1. Verify that a `find` command and two `getMore` commands were executed against the `db.coll` collection during the test.
338
349
*/
339
350
340
- it . skip ( 'send correct number of finds and getMores' , async function ( ) {
351
+ it ( 'send correct number of finds and getMores' , metadata , async function ( ) {
341
352
const cursor = client
342
353
. db ( 'db' )
343
354
. collection ( 'coll' )
344
- . find ( { } , { tailable : true , awaitData : true } )
355
+ . find ( { } , { tailable : true } )
345
356
. project ( { _id : 0 } ) ;
346
357
const doc = await cursor . next ( ) ;
347
358
expect ( doc ) . to . deep . equal ( { x : 1 } ) ;
@@ -358,7 +369,7 @@ describe('CSOT spec prose tests', function () {
358
369
expect ( commandStarted . filter ( e => e . command . find != null ) ) . to . have . lengthOf ( 1 ) ;
359
370
// Expect 2 getMore
360
371
expect ( commandStarted . filter ( e => e . command . getMore != null ) ) . to . have . lengthOf ( 2 ) ;
361
- } ) . skipReason = 'TODO(NODE-6305)' ;
372
+ } ) ;
362
373
} ) ;
363
374
364
375
context ( 'Change Streams' , ( ) => {
@@ -383,8 +394,11 @@ describe('CSOT spec prose tests', function () {
383
394
* - Expect this to fail with a timeout error.
384
395
* 1. Verify that an `aggregate` command and two `getMore` commands were executed against the `db.coll` collection during the test.
385
396
*/
386
- it . skip ( 'sends correct number of aggregate and getMores' , async function ( ) {
387
- const changeStream = client . db ( 'db' ) . collection ( 'coll' ) . watch ( ) ;
397
+ it . skip ( 'sends correct number of aggregate and getMores' , metadata , async function ( ) {
398
+ const changeStream = client
399
+ . db ( 'db' )
400
+ . collection ( 'coll' )
401
+ . watch ( [ ] , { timeoutMS : 20 , maxAwaitTimeMS : 19 } ) ;
388
402
const maybeError = await changeStream . next ( ) . then (
389
403
( ) => null ,
390
404
e => e
@@ -397,9 +411,9 @@ describe('CSOT spec prose tests', function () {
397
411
const getMores = commandStarted . filter ( e => e . command . getMore != null ) . map ( e => e . command ) ;
398
412
// Expect 1 aggregate
399
413
expect ( aggregates ) . to . have . lengthOf ( 1 ) ;
400
- // Expect 1 getMore
401
- expect ( getMores ) . to . have . lengthOf ( 1 ) ;
402
- } ) . skipReason = 'TODO(NODE-6305 )' ;
414
+ // Expect 2 getMores
415
+ expect ( getMores ) . to . have . lengthOf ( 2 ) ;
416
+ } ) . skipReason = 'TODO(NODE-6387 )' ;
403
417
} ) ;
404
418
} ) ;
405
419
0 commit comments