@@ -77,7 +77,7 @@ describe('CSOT spec prose tests', function () {
7777 beforeEach ( async function ( ) {
7878 await internalClient
7979 . db ( 'db' )
80- . collection ( 'coll ' )
80+ . collection ( 'bulkWriteTest ' )
8181 . drop ( )
8282 . catch ( ( ) => null ) ;
8383 await internalClient . db ( 'admin' ) . command ( failpoint ) ;
@@ -93,7 +93,7 @@ describe('CSOT spec prose tests', function () {
9393 const oneMBDocs = Array . from ( { length : 50 } , ( _ , _id ) => ( { _id, a } ) ) ;
9494 const error = await client
9595 . db ( 'db' )
96- . collection < { _id : number ; a : Uint8Array } > ( 'coll ' )
96+ . collection < { _id : number ; a : Uint8Array } > ( 'bulkWriteTest ' )
9797 . insertMany ( oneMBDocs )
9898 . catch ( error => error ) ;
9999
@@ -265,6 +265,7 @@ describe('CSOT spec prose tests', function () {
265265 } ) ;
266266
267267 context ( '5. Blocking Iteration Methods' , ( ) => {
268+ const metadata = { requires : { mongodb : '>=4.4' } } ;
268269 /**
269270 * Tests in this section MUST only be run against server versions 4.4 and higher and only apply to drivers that have a
270271 * 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 () {
276277 data : {
277278 failCommands : [ 'getMore' ] ,
278279 blockConnection : true ,
279- blockTimeMS : 20
280+ blockTimeMS : 90
280281 }
281282 } ;
282283 let internalClient : MongoClient ;
@@ -286,15 +287,25 @@ describe('CSOT spec prose tests', function () {
286287
287288 beforeEach ( async function ( ) {
288289 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 ) ;
290295 // Creating capped collection to be able to create tailable find cursor
291296 const coll = await internalClient
292297 . db ( 'db' )
293298 . createCollection ( 'coll' , { capped : true , size : 1_000_000 } ) ;
294299 await coll . insertOne ( { x : 1 } ) ;
295300 await internalClient . db ( ) . admin ( ) . command ( failpoint ) ;
296301
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+
298309 commandStarted = [ ] ;
299310 commandSucceeded = [ ] ;
300311
@@ -337,11 +348,11 @@ describe('CSOT spec prose tests', function () {
337348 * 1. Verify that a `find` command and two `getMore` commands were executed against the `db.coll` collection during the test.
338349 */
339350
340- it . skip ( 'send correct number of finds and getMores' , async function ( ) {
351+ it ( 'send correct number of finds and getMores' , metadata , async function ( ) {
341352 const cursor = client
342353 . db ( 'db' )
343354 . collection ( 'coll' )
344- . find ( { } , { tailable : true , awaitData : true } )
355+ . find ( { } , { tailable : true } )
345356 . project ( { _id : 0 } ) ;
346357 const doc = await cursor . next ( ) ;
347358 expect ( doc ) . to . deep . equal ( { x : 1 } ) ;
@@ -358,7 +369,7 @@ describe('CSOT spec prose tests', function () {
358369 expect ( commandStarted . filter ( e => e . command . find != null ) ) . to . have . lengthOf ( 1 ) ;
359370 // Expect 2 getMore
360371 expect ( commandStarted . filter ( e => e . command . getMore != null ) ) . to . have . lengthOf ( 2 ) ;
361- } ) . skipReason = 'TODO(NODE-6305)' ;
372+ } ) ;
362373 } ) ;
363374
364375 context ( 'Change Streams' , ( ) => {
@@ -383,8 +394,11 @@ describe('CSOT spec prose tests', function () {
383394 * - Expect this to fail with a timeout error.
384395 * 1. Verify that an `aggregate` command and two `getMore` commands were executed against the `db.coll` collection during the test.
385396 */
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 } ) ;
388402 const maybeError = await changeStream . next ( ) . then (
389403 ( ) => null ,
390404 e => e
@@ -397,9 +411,9 @@ describe('CSOT spec prose tests', function () {
397411 const getMores = commandStarted . filter ( e => e . command . getMore != null ) . map ( e => e . command ) ;
398412 // Expect 1 aggregate
399413 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 )' ;
403417 } ) ;
404418 } ) ;
405419
0 commit comments