@@ -707,11 +707,10 @@ describe('CSOT spec prose tests', function () {
707707 const bucket = new GridFSBucket ( client . db ( 'db' ) ) ;
708708 const stream = bucket . openUploadStream ( 'filename' ) ;
709709
710- const { result : maybeError , duration } = await measureDuration ( ( ) =>
711- pipeline ( Readable . from ( Buffer . from ( '13' , 'hex' ) ) , stream ) . catch ( error => error )
710+ const maybeError = pipeline ( Readable . from ( Buffer . from ( '13' , 'hex' ) ) , stream ) . catch (
711+ error => error
712712 ) ;
713713 expect ( maybeError ) . to . be . instanceof ( MongoOperationTimeoutError ) ;
714- expect ( duration ) . to . be . within ( 150 - 15 , 150 + 15 ) ;
715714 } ) ;
716715 it ( 'Aborting an upload stream can be timed out' , metadata , async function ( ) {
717716 // 1. Using `internalClient`, drop and re-create the `db.fs.files` and `db.fs.chunks` collections.
@@ -753,16 +752,12 @@ describe('CSOT spec prose tests', function () {
753752 const bucket = new GridFSBucket ( client . db ( 'db' ) , { chunkSizeBytes : 2 } ) ;
754753 const uploadStream = bucket . openUploadStream ( 'filename' ) ;
755754
756- const { duration } = await measureDuration ( async ( ) => {
757- await pipeline ( Readable . from ( Buffer . from ( '01020304' , 'hex' ) ) , uploadStream , {
758- end : false
759- } ) ;
760-
761- const timeoutError = await uploadStream . abort ( ) . catch ( error => error ) ;
762- expect ( timeoutError ) . to . be . instanceOf ( MongoOperationTimeoutError ) ;
755+ await pipeline ( Readable . from ( Buffer . from ( '01020304' , 'hex' ) ) , uploadStream , {
756+ end : false
763757 } ) ;
764758
765- expect ( duration ) . to . be . within ( 150 - 15 , 150 + 15 ) ;
759+ const timeoutError = await uploadStream . abort ( ) . catch ( error => error ) ;
760+ expect ( timeoutError ) . to . be . instanceOf ( MongoOperationTimeoutError ) ;
766761
767762 uploadStream . destroy ( ) ;
768763 } ) ;
0 commit comments