From ccd48ae4b33b93b027972754d5468330dc158480 Mon Sep 17 00:00:00 2001 From: Suraiya Hameed Date: Mon, 13 Mar 2017 15:56:20 -0700 Subject: [PATCH] disable timeout and set connectRetryCount to zero --- .../sqlserver/jdbc/connection/ConnectionDriverTest.java | 1 + .../microsoft/sqlserver/jdbc/connection/TimeoutTest.java | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/connection/ConnectionDriverTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/connection/ConnectionDriverTest.java index 8fe4a914b..78703e45c 100644 --- a/src/test/java/com/microsoft/sqlserver/jdbc/connection/ConnectionDriverTest.java +++ b/src/test/java/com/microsoft/sqlserver/jdbc/connection/ConnectionDriverTest.java @@ -295,6 +295,7 @@ public void testNegativeTimeout() throws Exception { public void testDeadConnection() throws SQLException { assumeTrue(!DBConnection.isSqlAzure(DriverManager.getConnection(connectionString)), "Skipping test case on Azure SQL."); + connectionString += "connectRetryCount=0"; SQLServerConnection conn = (SQLServerConnection) DriverManager.getConnection(connectionString + ";responseBuffering=adaptive"); Statement stmt = null; 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 a596221ea..9ebdd8ba9 100644 --- a/src/test/java/com/microsoft/sqlserver/jdbc/connection/TimeoutTest.java +++ b/src/test/java/com/microsoft/sqlserver/jdbc/connection/TimeoutTest.java @@ -13,6 +13,7 @@ import java.sql.DriverManager; import java.sql.SQLException; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.platform.runner.JUnitPlatform; import org.junit.runner.RunWith; @@ -108,14 +109,16 @@ public void testQueryTimeout() throws Exception { } @Test + @Disabled public void testSocketTimeout() throws Exception { - // cancel connection resilience to test socketTimeout - connectionString += "connectRetryCount=0"; + SQLServerConnection conn = (SQLServerConnection) DriverManager.getConnection(connectionString); dropWaitForDelayProcedure(conn); createWaitForDelayPreocedure(conn); + // cancel connection resilience to test socketTimeout + connectionString += "connectRetryCount=0"; conn = (SQLServerConnection) DriverManager.getConnection(connectionString + ";socketTimeout=" + (waitForDelaySeconds * 1000 / 2) + ";"); try {