@@ -240,8 +240,11 @@ describe('CSOT spec prose tests', function () {
240
240
beforeEach ( async function ( ) {
241
241
internalClient = this . configuration . newClient ( ) ;
242
242
await internalClient . db ( 'db' ) . dropCollection ( 'coll' ) ;
243
- await internalClient . db ( 'db' ) . createCollection ( 'coll' , { capped : true , size : 1_000_000 } ) ;
244
- await internalClient . db ( 'db' ) . collection ( 'coll' ) . insertOne ( { x : 1 } ) ;
243
+ // Creating capped collection to be able to create tailable find cursor
244
+ const coll = await internalClient
245
+ . db ( 'db' )
246
+ . createCollection ( 'coll' , { capped : true , size : 1_000_000 } ) ;
247
+ await coll . insertOne ( { x : 1 } ) ;
245
248
await internalClient . db ( ) . admin ( ) . command ( failpoint ) ;
246
249
247
250
client = this . configuration . newClient ( undefined , { timeoutMS : 20 , monitorCommands : true } ) ;
@@ -287,14 +290,13 @@ describe('CSOT spec prose tests', function () {
287
290
* 1. Verify that a `find` command and two `getMore` commands were executed against the `db.coll` collection during the test.
288
291
*/
289
292
290
- it ( 'send correct number of finds and getMores' , async function ( ) {
293
+ it . skip ( 'send correct number of finds and getMores' , async function ( ) {
291
294
const cursor = client
292
295
. db ( 'db' )
293
296
. collection ( 'coll' )
294
- . find ( { } , { tailable : true } )
297
+ . find ( { } , { tailable : true , awaitData : true } )
295
298
. project ( { _id : 0 } ) ;
296
299
const doc = await cursor . next ( ) ;
297
- // FIXME: Account for object id
298
300
expect ( doc ) . to . deep . equal ( { x : 1 } ) ;
299
301
// Check that there are no getMores sent
300
302
expect ( commandStarted . filter ( e => e . command . getMore != null ) ) . to . have . lengthOf ( 0 ) ;
@@ -305,10 +307,11 @@ describe('CSOT spec prose tests', function () {
305
307
) ;
306
308
307
309
expect ( maybeError ) . to . be . instanceof ( MongoOperationTimeoutError ) ;
308
- expect (
309
- commandStarted . filter ( e => e . command . find != null || e . command . getMore != null )
310
- ) . to . have . lengthOf ( 3 ) ;
311
- } ) ;
310
+ // Expect 1 find
311
+ expect ( commandStarted . filter ( e => e . command . find != null ) ) . to . have . lengthOf ( 1 ) ;
312
+ // Expect 2 getMore
313
+ expect ( commandStarted . filter ( e => e . command . getMore != null ) ) . to . have . lengthOf ( 2 ) ;
314
+ } ) . skipReason = 'TODO(NODE-6305)' ;
312
315
} ) ;
313
316
314
317
context ( 'Change Streams' , ( ) => {
@@ -333,20 +336,23 @@ describe('CSOT spec prose tests', function () {
333
336
* - Expect this to fail with a timeout error.
334
337
* 1. Verify that an `aggregate` command and two `getMore` commands were executed against the `db.coll` collection during the test.
335
338
*/
336
- it ( 'sends correct number of aggregate and getMores' , async function ( ) {
339
+ it . skip ( 'sends correct number of aggregate and getMores' , async function ( ) {
337
340
const changeStream = client . db ( 'db' ) . collection ( 'coll' ) . watch ( ) ;
338
341
const maybeError = await changeStream . next ( ) . then (
339
342
( ) => null ,
340
343
e => e
341
344
) ;
342
345
343
346
expect ( maybeError ) . to . be . instanceof ( MongoOperationTimeoutError ) ;
344
- expect (
345
- commandStarted . filter (
346
- e => Object . hasOwn ( e . command , 'aggregate' ) || Object . hasOwn ( e . command , 'getMore' )
347
- )
348
- ) . to . have . lengthOf ( 3 ) ;
349
- } ) ;
347
+ const aggregates = commandStarted
348
+ . filter ( e => e . command . aggregate != null )
349
+ . map ( e => e . command ) ;
350
+ const getMores = commandStarted . filter ( e => e . command . getMore != null ) . map ( e => e . command ) ;
351
+ // Expect 1 aggregate
352
+ expect ( aggregates ) . to . have . lengthOf ( 1 ) ;
353
+ // Expect 1 getMore
354
+ expect ( getMores ) . to . have . lengthOf ( 1 ) ;
355
+ } ) . skipReason = 'TODO(NODE-6305)' ;
350
356
} ) ;
351
357
} ) ;
352
358
0 commit comments