Skip to content

Commit 255f1da

Browse files
remove measuring of duration
1 parent b20b81b commit 255f1da

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)