5454import org .junit .jupiter .api .TestTemplate ;
5555import org .junit .jupiter .api .extension .ExtendWith ;
5656import org .junit .jupiter .params .provider .Arguments ;
57+ import software .amazon .jdbc .plugin .failover .FailoverConnectionPlugin ;
5758import software .amazon .jdbc .util .StringUtils ;
5859
5960@ TestMethodOrder (MethodOrderer .MethodName .class )
@@ -163,7 +164,7 @@ private void execute_FailureDetectionTime_EnhancedMonitoringEnabled(
163164 PLUGINS .set (props , "efm" );
164165
165166 final PerfStatMonitoring data = new PerfStatMonitoring ();
166- doMeasurePerformance (sleepDelayMillis , REPEAT_TIMES , props , false , data );
167+ doMeasurePerformance (sleepDelayMillis , REPEAT_TIMES , props , data );
167168 data .paramDetectionTime = detectionTime ;
168169 data .paramDetectionInterval = detectionInterval ;
169170 data .paramDetectionCount = detectionCount ;
@@ -224,9 +225,10 @@ private void execute_FailureDetectionTime_FailoverAndEnhancedMonitoringEnabled(
224225 .getInfo ()
225226 .getProxyDatabaseInfo ()
226227 .getInstanceEndpointSuffix ());
228+ FailoverConnectionPlugin .FAILOVER_MODE .set (props , "strict-reader" );
227229
228230 final PerfStatMonitoring data = new PerfStatMonitoring ();
229- doMeasurePerformance (sleepDelayMillis , REPEAT_TIMES , props , true , data );
231+ doMeasurePerformance (sleepDelayMillis , REPEAT_TIMES , props , data );
230232 data .paramDetectionTime = detectionTime ;
231233 data .paramDetectionInterval = detectionInterval ;
232234 data .paramDetectionCount = detectionCount ;
@@ -279,9 +281,10 @@ private void execute_FailoverTime_SocketTimeout(int socketTimeout, int sleepDela
279281 .getProxyDatabaseInfo ()
280282 .getInstanceEndpointSuffix ());
281283 props .setProperty ("failoverTimeoutMs" , Integer .toString (PERF_FAILOVER_TIMEOUT_MS ));
284+ FailoverConnectionPlugin .FAILOVER_MODE .set (props , "strict-reader" );
282285
283286 final PerfStatSocketTimeout data = new PerfStatSocketTimeout ();
284- doMeasurePerformance (sleepDelayMillis , REPEAT_TIMES , props , true , data );
287+ doMeasurePerformance (sleepDelayMillis , REPEAT_TIMES , props , data );
285288 data .paramSocketTimeout = socketTimeout ;
286289 failoverWithSocketTimeoutPerfDataList .add (data );
287290 }
@@ -290,7 +293,6 @@ private void doMeasurePerformance(
290293 int sleepDelayMillis ,
291294 int repeatTimes ,
292295 Properties props ,
293- boolean openReadOnlyConnection ,
294296 PerfStatBase data )
295297 throws SQLException {
296298
@@ -324,7 +326,6 @@ private void doMeasurePerformance(
324326 try (final Connection conn = openConnectionWithRetry (props );
325327 final Statement statement = conn .createStatement ()) {
326328
327- conn .setReadOnly (openReadOnlyConnection );
328329 thread .start ();
329330
330331 // Execute long query
0 commit comments