@@ -21,20 +21,21 @@ import { AuroraTestUtility } from "./utils/aurora_test_utility";
2121import { logger } from "../../../../common/logutils" ;
2222import { DatabaseEngine } from "./utils/database_engine" ;
2323import { TestEnvironmentFeatures } from "./utils/test_environment_features" ;
24- import { features } from "./config" ;
24+ import { features , instanceCount } from "./config" ;
2525import { DatabaseEngineDeployment } from "./utils/database_engine_deployment" ;
2626import { PluginManager } from "../../../../index" ;
2727
2828const itIf =
2929 ! features . includes ( TestEnvironmentFeatures . PERFORMANCE ) && ! features . includes ( TestEnvironmentFeatures . RUN_AUTOSCALING_TESTS_ONLY ) ? it : it . skip ;
30+ const itIfMinTwoInstance = instanceCount >= 2 ? itIf : it . skip ;
3031
3132let client : any ;
3233let auroraTestUtility : AuroraTestUtility ;
3334
34- async function executeInstanceQuery ( client : any , engine : DatabaseEngine , deployment : DatabaseEngineDeployment , props : any ) : Promise < void > {
35+ async function executeSelect1 ( client : any , engine : DatabaseEngine , deployment : DatabaseEngineDeployment , props : any ) : Promise < void > {
3536 await client . connect ( ) ;
3637
37- const res = await DriverHelper . executeInstanceQuery ( engine , deployment , client ) ;
38+ const res = await DriverHelper . executeQuery ( engine , client , "SELECT 1" , 10000 ) ;
3839
3940 expect ( res ) . not . toBeNull ( ) ;
4041}
@@ -59,8 +60,8 @@ afterEach(async () => {
5960 logger . info ( `Test finished: ${ expect . getState ( ) . currentTestName } ` ) ;
6061} , 1320000 ) ;
6162
62- describe ( "basic_connectivity " , ( ) => {
63- itIf (
63+ describe ( "basic connectivity " , ( ) => {
64+ itIfMinTwoInstance (
6465 "wrapper with failover plugins read only endpoint" ,
6566 async ( ) => {
6667 const env = await TestEnvironment . getCurrent ( ) ;
@@ -82,12 +83,12 @@ describe("basic_connectivity", () => {
8283 props = DriverHelper . addDriverSpecificConfiguration ( props , env . engine ) ;
8384 client = initClientFunc ( props ) ;
8485
85- await executeInstanceQuery ( client , env . engine , env . deployment , props ) ;
86+ await executeSelect1 ( client , env . engine , env . deployment , props ) ;
8687 } ,
8788 1320000
8889 ) ;
8990
90- itIf (
91+ itIfMinTwoInstance (
9192 "wrapper with failover plugins cluster endpoint" ,
9293 async ( ) => {
9394 const env = await TestEnvironment . getCurrent ( ) ;
@@ -109,7 +110,7 @@ describe("basic_connectivity", () => {
109110 props = DriverHelper . addDriverSpecificConfiguration ( props , env . engine ) ;
110111
111112 client = initClientFunc ( props ) ;
112- await executeInstanceQuery ( client , env . engine , env . deployment , props ) ;
113+ await executeSelect1 ( client , env . engine , env . deployment , props ) ;
113114 } ,
114115 1320000
115116 ) ;
@@ -136,7 +137,7 @@ describe("basic_connectivity", () => {
136137 props = DriverHelper . addDriverSpecificConfiguration ( props , env . engine ) ;
137138
138139 client = initClientFunc ( props ) ;
139- await executeInstanceQuery ( client , env . engine , env . deployment , props ) ;
140+ await executeSelect1 ( client , env . engine , env . deployment , props ) ;
140141 } ,
141142 1320000
142143 ) ;
@@ -165,15 +166,15 @@ describe("basic_connectivity", () => {
165166 client = initClientFunc ( props ) ;
166167 await client . connect ( ) ;
167168
168- const res = await DriverHelper . executeInstanceQuery ( env . engine , env . deployment , client ) ;
169+ const res = await executeSelect1 ( client , env . engine , env . deployment , props ) ;
169170
170171 expect ( res ) . not . toBeNull ( ) ;
171172 } ,
172173 1320000
173174 ) ;
174175
175176 itIf (
176- "wrapper_proxy " ,
177+ "wrapper proxy " ,
177178 async ( ) => {
178179 const env = await TestEnvironment . getCurrent ( ) ;
179180 const driver = DriverHelper . getDriverForDatabaseEngine ( env . engine ) ;
0 commit comments