@@ -3487,17 +3487,16 @@ describe.each([
3487
3487
)
3488
3488
const auth = acquireAuth
3489
3489
3490
- const delegatedConnection = await connectionProvider
3490
+ const acquiredConnection = await connectionProvider
3491
3491
. acquireConnection ( {
3492
3492
accessMode : 'READ' ,
3493
3493
database : '' ,
3494
3494
allowStickyConnection,
3495
3495
auth
3496
3496
} )
3497
3497
3498
- expect ( delegatedConnection ) . toBeInstanceOf ( DelegateConnection )
3499
- expect ( delegatedConnection . _delegate ) . toBe ( connection )
3500
- expect ( connection . _sticky ) . toEqual ( false )
3498
+ expect ( acquiredConnection ) . toBe ( connection )
3499
+ expect ( acquiredConnection . _sticky ) . toEqual ( false )
3501
3500
} )
3502
3501
3503
3502
it ( 'should return connection when try switch user on acquire [expired rt]' , async ( ) => {
@@ -3530,20 +3529,19 @@ describe.each([
3530
3529
3531
3530
const auth = acquireAuth
3532
3531
3533
- const delegatedConnection = await connectionProvider
3532
+ const acquiredConnection = await connectionProvider
3534
3533
. acquireConnection ( {
3535
3534
accessMode : 'READ' ,
3536
3535
database : 'dba' ,
3537
3536
allowStickyConnection,
3538
3537
auth
3539
3538
} )
3540
3539
3541
- expect ( delegatedConnection ) . toBeInstanceOf ( DelegateConnection )
3542
- expect ( delegatedConnection . _delegate ) . toBe ( connection )
3543
- expect ( connection . _sticky ) . toEqual ( false )
3540
+ expect ( acquiredConnection ) . toBe ( connection )
3541
+ expect ( acquiredConnection . _sticky ) . toEqual ( false )
3544
3542
} )
3545
3543
3546
- it ( 'should return delegated connection when try switch user on acquire [expired rt and userSeedRouter]' , async ( ) => {
3544
+ it ( 'should return connection when try switch user on acquire [expired rt and userSeedRouter]' , async ( ) => {
3547
3545
const address = ServerAddress . fromUrl ( 'localhost:123' )
3548
3546
const pool = newPool ( )
3549
3547
const connection = new FakeConnection ( address , ( ) => { } , undefined , PROTOCOL_VERSION , null , connAuth , { supportsReAuth : true } )
@@ -3575,20 +3573,19 @@ describe.each([
3575
3573
3576
3574
const auth = acquireAuth
3577
3575
3578
- const delegatedConnection = await connectionProvider
3576
+ const acquiredConnection = await connectionProvider
3579
3577
. acquireConnection ( {
3580
3578
accessMode : 'READ' ,
3581
3579
database : 'dba' ,
3582
3580
allowStickyConnection,
3583
3581
auth
3584
3582
} )
3585
3583
3586
- expect ( delegatedConnection ) . toBeInstanceOf ( DelegateConnection )
3587
- expect ( delegatedConnection . _delegate ) . toBe ( connection )
3588
- expect ( connection . _sticky ) . toEqual ( false )
3584
+ expect ( acquiredConnection ) . toBe ( connection )
3585
+ expect ( acquiredConnection . _sticky ) . toEqual ( false )
3589
3586
} )
3590
3587
3591
- it ( 'should delegated connection when try switch user on acquire [firstCall and userSeedRouter]' , async ( ) => {
3588
+ it ( 'should not delegated connection when try switch user on acquire [firstCall and userSeedRouter]' , async ( ) => {
3592
3589
const address = ServerAddress . fromUrl ( 'localhost:123' )
3593
3590
const pool = newPool ( )
3594
3591
const connection = new FakeConnection ( address , ( ) => { } , undefined , PROTOCOL_VERSION , null , connAuth , { supportsReAuth : true } )
@@ -3612,17 +3609,16 @@ describe.each([
3612
3609
3613
3610
const auth = acquireAuth
3614
3611
3615
- const delegatedConnection = await connectionProvider
3612
+ const acquiredConnection = await connectionProvider
3616
3613
. acquireConnection ( {
3617
3614
accessMode : 'READ' ,
3618
3615
database : 'dba' ,
3619
3616
allowStickyConnection,
3620
3617
auth
3621
3618
} )
3622
3619
3623
- expect ( delegatedConnection ) . toBeInstanceOf ( DelegateConnection )
3624
- expect ( delegatedConnection . _delegate ) . toBe ( connection )
3625
- expect ( connection . _sticky ) . toEqual ( false )
3620
+ expect ( acquiredConnection ) . toBe ( connection )
3621
+ expect ( acquiredConnection . _sticky ) . toEqual ( false )
3626
3622
} )
3627
3623
} )
3628
3624
} )
@@ -3895,17 +3891,16 @@ describe.each([
3895
3891
)
3896
3892
const auth = acquireAuth
3897
3893
3898
- const delegatedConnection = await connectionProvider
3894
+ const acquiredConnection = await connectionProvider
3899
3895
. acquireConnection ( {
3900
3896
accessMode : 'READ' ,
3901
3897
database : '' ,
3902
3898
allowStickyConnection,
3903
3899
auth
3904
3900
} )
3905
3901
3906
- expect ( delegatedConnection ) . toBeInstanceOf ( DelegateConnection )
3907
- expect ( delegatedConnection . _delegate ) . toBe ( connection )
3908
- expect ( connection . _sticky ) . toEqual ( false )
3902
+ expect ( acquiredConnection ) . toBe ( connection )
3903
+ expect ( acquiredConnection . _sticky ) . toEqual ( false )
3909
3904
} )
3910
3905
3911
3906
it ( 'should return connection when try switch user on acquire [expired rt]' , async ( ) => {
@@ -3938,20 +3933,19 @@ describe.each([
3938
3933
3939
3934
const auth = acquireAuth
3940
3935
3941
- const delegatedConnection = await connectionProvider
3936
+ const acquiredConnection = await connectionProvider
3942
3937
. acquireConnection ( {
3943
3938
accessMode : 'READ' ,
3944
3939
database : 'dba' ,
3945
3940
allowStickyConnection,
3946
3941
auth
3947
3942
} )
3948
3943
3949
- expect ( delegatedConnection ) . toBeInstanceOf ( DelegateConnection )
3950
- expect ( delegatedConnection . _delegate ) . toBe ( connection )
3951
- expect ( connection . _sticky ) . toEqual ( false )
3944
+ expect ( acquiredConnection ) . toBe ( connection )
3945
+ expect ( acquiredConnection . _sticky ) . toEqual ( false )
3952
3946
} )
3953
3947
3954
- it ( 'should return delegated connection when try switch user on acquire [expired rt and userSeedRouter]' , async ( ) => {
3948
+ it ( 'should return connection when try switch user on acquire [expired rt and userSeedRouter]' , async ( ) => {
3955
3949
const address = ServerAddress . fromUrl ( 'localhost:123' )
3956
3950
const pool = newPool ( )
3957
3951
const connection = new FakeConnection ( address , ( ) => { } , undefined , PROTOCOL_VERSION , null , connAuth , { supportsReAuth : true } )
@@ -3983,20 +3977,19 @@ describe.each([
3983
3977
3984
3978
const auth = acquireAuth
3985
3979
3986
- const delegatedConnection = await connectionProvider
3980
+ const acquiredConnection = await connectionProvider
3987
3981
. acquireConnection ( {
3988
3982
accessMode : 'READ' ,
3989
3983
database : 'dba' ,
3990
3984
allowStickyConnection,
3991
3985
auth
3992
3986
} )
3993
3987
3994
- expect ( delegatedConnection ) . toBeInstanceOf ( DelegateConnection )
3995
- expect ( delegatedConnection . _delegate ) . toBe ( connection )
3996
- expect ( connection . _sticky ) . toEqual ( false )
3988
+ expect ( acquiredConnection ) . toBe ( connection )
3989
+ expect ( acquiredConnection . _sticky ) . toEqual ( false )
3997
3990
} )
3998
3991
3999
- it ( 'should delegated connection when try switch user on acquire [firstCall and userSeedRouter]' , async ( ) => {
3992
+ it ( 'should not delegated connection when try switch user on acquire [firstCall and userSeedRouter]' , async ( ) => {
4000
3993
const address = ServerAddress . fromUrl ( 'localhost:123' )
4001
3994
const pool = newPool ( )
4002
3995
const connection = new FakeConnection ( address , ( ) => { } , undefined , PROTOCOL_VERSION , null , connAuth , { supportsReAuth : true } )
@@ -4020,17 +4013,16 @@ describe.each([
4020
4013
4021
4014
const auth = acquireAuth
4022
4015
4023
- const delegatedConnection = await connectionProvider
4016
+ const acquiredConnection = await connectionProvider
4024
4017
. acquireConnection ( {
4025
4018
accessMode : 'READ' ,
4026
4019
database : 'dba' ,
4027
4020
allowStickyConnection,
4028
4021
auth
4029
4022
} )
4030
4023
4031
- expect ( delegatedConnection ) . toBeInstanceOf ( DelegateConnection )
4032
- expect ( delegatedConnection . _delegate ) . toBe ( connection )
4033
- expect ( connection . _sticky ) . toEqual ( false )
4024
+ expect ( acquiredConnection ) . toBe ( connection )
4025
+ expect ( acquiredConnection . _sticky ) . toEqual ( false )
4034
4026
} )
4035
4027
} )
4036
4028
} )
0 commit comments