Skip to content

Commit 07268c4

Browse files
committed
fixe
1 parent bb76a78 commit 07268c4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/test/java/com/microsoft/sqlserver/jdbc/connection/TimeoutTest.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import com.microsoft.sqlserver.jdbc.RandomUtil;
2828
import com.microsoft.sqlserver.jdbc.SQLServerDataSource;
29+
import com.microsoft.sqlserver.jdbc.SQLServerDriver;
2930
import com.microsoft.sqlserver.jdbc.SQLServerStatement;
3031
import com.microsoft.sqlserver.jdbc.TestResource;
3132
import com.microsoft.sqlserver.jdbc.TestUtils;
@@ -275,7 +276,12 @@ public void testAzureEndpointRetry() {
275276
} else if (TestUtils.isAzure(con)) {
276277
assertTrue(retryCount == 2); // AZURE_SERVER_ENDPOINT_RETRY_COUNT_DEFAFULT
277278
} else {
278-
assertTrue(retryCount == 1); // default connectRetryCount
279+
// default retryCount is 1 if not set in connection string
280+
String retryCountFromConnStr = TestUtils.getProperty(connectionString, "connectRetryCount");
281+
int expectedRetryCount = (retryCountFromConnStr != null) ? Integer
282+
.parseInt(retryCountFromConnStr) : 1;
283+
284+
assertTrue(retryCount == expectedRetryCount); // default connectRetryCount
279285
}
280286
}
281287
}

0 commit comments

Comments
 (0)