@@ -537,7 +537,7 @@ describe('CRUD API explain option', function () {
537
537
describe ( 'fluent api timeoutMS precedence and inheritance' , function ( ) {
538
538
describe ( 'find({}, { timeoutMS }).explain()' , function ( ) {
539
539
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 } ) ;
541
541
542
542
const { result, duration } = await measureDuration ( ( ) =>
543
543
cursor . explain ( { verbosity : 'queryPlanner' } ) . catch ( e => e )
@@ -549,7 +549,7 @@ describe('CRUD API explain option', function () {
549
549
] = commands ;
550
550
expect ( maxTimeMS ) . to . exist ;
551
551
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 ) ;
553
553
} ) ;
554
554
} ) ;
555
555
@@ -558,7 +558,7 @@ describe('CRUD API explain option', function () {
558
558
const cursor = client . db ( 'foo' ) . collection ( 'bar' ) . find ( ) ;
559
559
560
560
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 )
562
562
) ;
563
563
const [
564
564
{
@@ -567,15 +567,15 @@ describe('CRUD API explain option', function () {
567
567
] = commands ;
568
568
expect ( maxTimeMS ) . to . exist ;
569
569
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 ) ;
571
571
} ) ;
572
572
} ) ;
573
573
574
574
describe ( 'find({}, { timeoutMS} ).explain({}, { timeoutMS })' , function ( ) {
575
575
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 } ) ;
577
577
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 )
579
579
) ;
580
580
const [
581
581
{
@@ -584,13 +584,13 @@ describe('CRUD API explain option', function () {
584
584
] = commands ;
585
585
expect ( maxTimeMS ) . to . exist ;
586
586
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 ) ;
588
588
} ) ;
589
589
} ) ;
590
590
591
591
describe ( 'aggregate([], { timeoutMS }).explain()' , function ( ) {
592
592
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 } ) ;
594
594
const { result, duration } = await measureDuration ( ( ) =>
595
595
cursor . explain ( { verbosity : 'queryPlanner' } ) . catch ( e => e )
596
596
) ;
@@ -602,15 +602,15 @@ describe('CRUD API explain option', function () {
602
602
] = commands ;
603
603
expect ( maxTimeMS ) . to . exist ;
604
604
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 ) ;
606
606
} ) ;
607
607
} ) ;
608
608
609
609
describe ( 'aggregate([], { timeoutMS })' , function ( ) {
610
610
test ( 'respects the timeoutMS from the explain helper' , async function ( ) {
611
611
const cursor = client . db ( 'foo' ) . collection ( 'bar' ) . aggregate ( ) ;
612
612
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 )
614
614
) ;
615
615
const [
616
616
{
@@ -619,23 +619,23 @@ describe('CRUD API explain option', function () {
619
619
] = commands ;
620
620
expect ( maxTimeMS ) . to . exist ;
621
621
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 ) ;
623
623
} ) ;
624
624
} ) ;
625
625
626
626
describe ( 'aggregate([], { timeoutMS} ).explain({}, { timeoutMS })' , function ( ) {
627
627
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 } ) ;
629
629
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 )
631
631
) ;
632
632
const [
633
633
{
634
634
command : { maxTimeMS }
635
635
}
636
636
] = commands ;
637
637
expect ( maxTimeMS ) . to . exist ;
638
- expect ( duration ) . to . be . within ( 1000 - 100 , 1000 + 100 ) ;
638
+ expect ( duration ) . to . be . within ( 800 - 100 , 800 + 100 ) ;
639
639
expect ( result ) . to . be . instanceOf ( MongoOperationTimeoutError ) ;
640
640
} ) ;
641
641
} ) ;
0 commit comments