Skip to content

Commit

Permalink
Merge pull request #199 from v-suhame/connectionResiliency
Browse files Browse the repository at this point in the history
disable timeout and set connectRetryCount to zero
  • Loading branch information
Suraiya Hameed authored Mar 13, 2017
2 parents de50fde + ccd48ae commit a1ffbe3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit a1ffbe3

Please sign in to comment.