@@ -3,7 +3,6 @@ import { once } from 'node:events';
33import { expect } from 'chai' ;
44
55import { Binary , type Collection , type Db , type MongoClient , MongoServerError } from '../../../src' ;
6- import { sleep } from '../../tools/utils' ;
76
87describe ( 'Cursor Streams' , function ( ) {
98 let client : MongoClient ;
@@ -65,29 +64,6 @@ describe('Cursor Streams', function () {
6564 expect ( docCount ) . to . equal ( 100 ) ;
6665 } ) ;
6766
68- it ( 'should respect manual pause() and resume() calls' , async function ( ) {
69- const collection = db . collection < { _id : number } > ( 'streaming_test' ) ;
70- await setupCollection ( collection , 10 ) ;
71-
72- const stream = collection . find ( { } , { batchSize : 2 } ) . stream ( ) ;
73- let docCount = 0 ;
74-
75- await new Promise ( ( resolve , reject ) => {
76- stream . on ( 'error' , reject ) ;
77- stream . on ( 'end' , resolve ) ;
78- stream . on ( 'data' , ( ) => {
79- docCount ++ ;
80- // Manually pause the stream
81- stream . pause ( ) ;
82-
83- // Perform an async operation, then resume
84- sleep ( 100 ) . then ( ( ) => stream . resume ( ) ) ;
85- } ) ;
86- } ) ;
87-
88- expect ( docCount ) . to . equal ( 10 ) ;
89- } ) ;
90-
9167 it ( 'should throws error' , async function ( ) {
9268 const cursor = db . collection ( 'myCollection' ) . find ( {
9369 timestamp : { $ltx : '1111' } // Error in query.
0 commit comments