From 183426a7c4ff305342a976b471f9e094a44ac259 Mon Sep 17 00:00:00 2001 From: lilgreenbird Date: Mon, 29 Jan 2024 17:03:01 -0800 Subject: [PATCH] Fixed test to check for retryCount set in connection string (#2308) --- .../microsoft/sqlserver/jdbc/connection/TimeoutTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/connection/TimeoutTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/connection/TimeoutTest.java index 49b05e713..af2bda8af 100644 --- a/src/test/java/com/microsoft/sqlserver/jdbc/connection/TimeoutTest.java +++ b/src/test/java/com/microsoft/sqlserver/jdbc/connection/TimeoutTest.java @@ -275,7 +275,12 @@ public void testAzureEndpointRetry() { } else if (TestUtils.isAzure(con)) { assertTrue(retryCount == 2); // AZURE_SERVER_ENDPOINT_RETRY_COUNT_DEFAFULT } else { - assertTrue(retryCount == 1); // default connectRetryCount + // default retryCount is 1 if not set in connection string + String retryCountFromConnStr = TestUtils.getProperty(connectionString, "connectRetryCount"); + int expectedRetryCount = (retryCountFromConnStr != null) ? Integer + .parseInt(retryCountFromConnStr) : 1; + + assertTrue(retryCount == expectedRetryCount); // default connectRetryCount } } }