@@ -1491,33 +1491,33 @@ describe('Spanner with mock server', () => {
1491
1491
} ) ;
1492
1492
1493
1493
describe ( 'LeaderAwareRouting' , ( ) => {
1494
- let spannerWithLARDisabled : Spanner ;
1495
- let instanceWithLARDisabled : Instance ;
1494
+ let spannerWithLAREnabled : Spanner ;
1495
+ let instanceWithLAREnabled : Instance ;
1496
1496
1497
- function newTestDatabaseWithLARDisabled (
1497
+ function newTestDatabaseWithLAREnabled (
1498
1498
options ?: SessionPoolOptions ,
1499
1499
queryOptions ?: IQueryOptions
1500
1500
) : Database {
1501
- return instanceWithLARDisabled . database (
1501
+ return instanceWithLAREnabled . database (
1502
1502
`database-${ dbCounter ++ } ` ,
1503
1503
options ,
1504
1504
queryOptions
1505
1505
) ;
1506
1506
}
1507
1507
1508
1508
before ( ( ) => {
1509
- spannerWithLARDisabled = new Spanner ( {
1509
+ spannerWithLAREnabled = new Spanner ( {
1510
1510
servicePath : 'localhost' ,
1511
1511
port,
1512
1512
sslCreds : grpc . credentials . createInsecure ( ) ,
1513
- routeToLeaderEnabled : false ,
1513
+ routeToLeaderEnabled : true ,
1514
1514
} ) ;
1515
1515
// Gets a reference to a Cloud Spanner instance and database
1516
- instanceWithLARDisabled = spannerWithLARDisabled . instance ( 'instance' ) ;
1516
+ instanceWithLAREnabled = spannerWithLAREnabled . instance ( 'instance' ) ;
1517
1517
} ) ;
1518
1518
1519
1519
it ( 'should execute with leader aware routing enabled in a read/write transaction' , async ( ) => {
1520
- const database = newTestDatabase ( ) ;
1520
+ const database = newTestDatabaseWithLAREnabled ( ) ;
1521
1521
await database . runTransactionAsync ( async tx => {
1522
1522
await tx ! . runUpdate ( {
1523
1523
sql : insertSql ,
@@ -1539,7 +1539,7 @@ describe('Spanner with mock server', () => {
1539
1539
} ) ;
1540
1540
1541
1541
it ( 'should execute with leader aware routing disabled in a read/write transaction' , async ( ) => {
1542
- const database = newTestDatabaseWithLARDisabled ( ) ;
1542
+ const database = newTestDatabase ( ) ;
1543
1543
await database . runTransactionAsync ( async tx => {
1544
1544
await tx ! . runUpdate ( {
1545
1545
sql : insertSql ,
0 commit comments