Skip to content

Commit 904bec2

Browse files
foo bar baz?
1 parent 4900134 commit 904bec2

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

package-lock.json

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"mocha": "^10.4.0",
9898
"mocha-sinon": "^2.1.2",
9999
"mongodb-client-encryption": "^6.1.0",
100-
"mongodb-legacy": "https://github.com/mongodb-js/nodejs-mongodb-legacy.git#645707820b903b8ae3c2b5b400cb214eab3b95ab",
100+
"mongodb-legacy": "^6.1.3",
101101
"nyc": "^15.1.0",
102102
"prettier": "^3.3.3",
103103
"semver": "^7.6.3",

test/integration/crud/explain.test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ describe('CRUD API explain option', function () {
537537
describe('fluent api timeoutMS precedence and inheritance', function () {
538538
describe('find({}, { timeoutMS }).explain()', function () {
539539
test('respects the timeoutMS from the find options', async function () {
540-
const cursor = client.db('foo').collection('bar').find({}, { timeoutMS: 1000 });
540+
const cursor = client.db('foo').collection('bar').find({}, { timeoutMS: 800 });
541541

542542
const { result, duration } = await measureDuration(() =>
543543
cursor.explain({ verbosity: 'queryPlanner' }).catch(e => e)
@@ -549,7 +549,7 @@ describe('CRUD API explain option', function () {
549549
] = commands;
550550
expect(maxTimeMS).to.exist;
551551
expect(result).to.be.instanceOf(MongoOperationTimeoutError);
552-
expect(duration).to.be.within(1000 - 100, 1000 + 100);
552+
expect(duration).to.be.within(800 - 100, 800 + 100);
553553
});
554554
});
555555

@@ -558,7 +558,7 @@ describe('CRUD API explain option', function () {
558558
const cursor = client.db('foo').collection('bar').find();
559559

560560
const { result, duration } = await measureDuration(() =>
561-
cursor.explain({ verbosity: 'queryPlanner' }, { timeoutMS: 1000 }).catch(e => e)
561+
cursor.explain({ verbosity: 'queryPlanner' }, { timeoutMS: 800 }).catch(e => e)
562562
);
563563
const [
564564
{
@@ -567,15 +567,15 @@ describe('CRUD API explain option', function () {
567567
] = commands;
568568
expect(maxTimeMS).to.exist;
569569
expect(result).to.be.instanceOf(MongoOperationTimeoutError);
570-
expect(duration).to.be.within(1000 - 100, 1000 + 100);
570+
expect(duration).to.be.within(800 - 100, 800 + 100);
571571
});
572572
});
573573

574574
describe('find({}, { timeoutMS} ).explain({}, { timeoutMS })', function () {
575575
test('the timeoutMS from the explain helper has precedence', async function () {
576-
const cursor = client.db('foo').collection('bar').find({}, { timeoutMS: 2000 });
576+
const cursor = client.db('foo').collection('bar').find({}, { timeoutMS: 100 });
577577
const { result, duration } = await measureDuration(() =>
578-
cursor.explain({ verbosity: 'queryPlanner' }, { timeoutMS: 1000 }).catch(e => e)
578+
cursor.explain({ verbosity: 'queryPlanner' }, { timeoutMS: 800 }).catch(e => e)
579579
);
580580
const [
581581
{
@@ -584,13 +584,13 @@ describe('CRUD API explain option', function () {
584584
] = commands;
585585
expect(maxTimeMS).to.exist;
586586
expect(result).to.be.instanceOf(MongoOperationTimeoutError);
587-
expect(duration).to.be.within(1000 - 100, 1000 + 100);
587+
expect(duration).to.be.within(800 - 100, 800 + 100);
588588
});
589589
});
590590

591591
describe('aggregate([], { timeoutMS }).explain()', function () {
592592
test('respects the timeoutMS from the find options', async function () {
593-
const cursor = client.db('foo').collection('bar').aggregate([], { timeoutMS: 1000 });
593+
const cursor = client.db('foo').collection('bar').aggregate([], { timeoutMS: 800 });
594594
const { result, duration } = await measureDuration(() =>
595595
cursor.explain({ verbosity: 'queryPlanner' }).catch(e => e)
596596
);
@@ -602,15 +602,15 @@ describe('CRUD API explain option', function () {
602602
] = commands;
603603
expect(maxTimeMS).to.exist;
604604
expect(result).to.be.instanceOf(MongoOperationTimeoutError);
605-
expect(duration).to.be.within(1000 - 100, 1000 + 100);
605+
expect(duration).to.be.within(800 - 100, 800 + 100);
606606
});
607607
});
608608

609609
describe('aggregate([], { timeoutMS })', function () {
610610
test('respects the timeoutMS from the explain helper', async function () {
611611
const cursor = client.db('foo').collection('bar').aggregate();
612612
const { result, duration } = await measureDuration(() =>
613-
cursor.explain({ verbosity: 'queryPlanner' }, { timeoutMS: 1000 }).catch(e => e)
613+
cursor.explain({ verbosity: 'queryPlanner' }, { timeoutMS: 800 }).catch(e => e)
614614
);
615615
const [
616616
{
@@ -619,23 +619,23 @@ describe('CRUD API explain option', function () {
619619
] = commands;
620620
expect(maxTimeMS).to.exist;
621621
expect(result).to.be.instanceOf(MongoOperationTimeoutError);
622-
expect(duration).to.be.within(1000 - 100, 1000 + 100);
622+
expect(duration).to.be.within(800 - 100, 800 + 100);
623623
});
624624
});
625625

626626
describe('aggregate([], { timeoutMS} ).explain({}, { timeoutMS })', function () {
627627
test('the timeoutMS from the explain helper has precedence', async function () {
628-
const cursor = client.db('foo').collection('bar').aggregate([], { timeoutMS: 2000 });
628+
const cursor = client.db('foo').collection('bar').aggregate([], { timeoutMS: 100 });
629629
const { duration, result } = await measureDuration(() =>
630-
cursor.explain({ verbosity: 'queryPlanner' }, { timeoutMS: 1000 }).catch(e => e)
630+
cursor.explain({ verbosity: 'queryPlanner' }, { timeoutMS: 800 }).catch(e => e)
631631
);
632632
const [
633633
{
634634
command: { maxTimeMS }
635635
}
636636
] = commands;
637637
expect(maxTimeMS).to.exist;
638-
expect(duration).to.be.within(1000 - 100, 1000 + 100);
638+
expect(duration).to.be.within(800 - 100, 800 + 100);
639639
expect(result).to.be.instanceOf(MongoOperationTimeoutError);
640640
});
641641
});

0 commit comments

Comments
 (0)