diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionTest.java index ee4263dc7..9a05bef62 100644 --- a/src/test/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionTest.java +++ b/src/test/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionTest.java @@ -461,7 +461,7 @@ public void testConnectCountInLoginAndCorrectRetryCount() { int connectRetryCount = 3; int connectRetryInterval = 1; - int longLoginTimeout = loginTimeOutInSeconds * 4; // 120 seconds + int longLoginTimeout = loginTimeOutInSeconds * 4; // 40 seconds try { SQLServerDataSource ds = new SQLServerDataSource(); @@ -480,12 +480,12 @@ public void testConnectCountInLoginAndCorrectRetryCount() { long totalTime = System.currentTimeMillis() - timerStart; int expectedMinimumTimeInMillis = (connectRetryCount * connectRetryInterval) * 1000; // 3 seconds - System.out.println("TOTAL TIME: " + totalTime); + System.out.println("testConnectCountInLoginAndCorrectRetryCount TOTAL TIME: " + totalTime); // Minimum time is 0 seconds per attempt and connectRetryInterval * connectRetryCount seconds of interval. // Maximum is unknown, but is needs to be less than longLoginTimeout or else this is an issue. assertTrue(totalTime > expectedMinimumTimeInMillis, TestResource.getResource("R_executionNotLong")); - assertTrue(totalTime < 0.9 * (longLoginTimeout * 1000L), TestResource.getResource("R_executionTooLong")); + assertTrue(totalTime < longLoginTimeout * 1000L, TestResource.getResource("R_executionTooLong")); } } @@ -500,7 +500,7 @@ public void testConnectCountInLoginAndCorrectRetryCountWithZeroRetry() { int connectRetryCount = 0; int connectRetryInterval = 60; - int longLoginTimeout = loginTimeOutInSeconds * 3; // 90 seconds + int longLoginTimeout = loginTimeOutInSeconds * 3; // 30 seconds try { SQLServerDataSource ds = new SQLServerDataSource(); @@ -518,10 +518,10 @@ public void testConnectCountInLoginAndCorrectRetryCountWithZeroRetry() { assertTrue(e.getMessage().contains(TestResource.getResource("R_cannotOpenDatabase")), e.getMessage()); long totalTime = System.currentTimeMillis() - timerStart; - System.out.println("TOTAL TIME: " + totalTime); + System.out.println("testConnectCountInLoginAndCorrectRetryCountWithZeroRetry TOTAL TIME: " + totalTime); // Maximum is unknown, but is needs to be less than longLoginTimeout or else this is an issue. - assertTrue(totalTime < 0.9 * (longLoginTimeout * 1000L), TestResource.getResource("R_executionTooLong")); + assertTrue(totalTime < longLoginTimeout * 1000L, TestResource.getResource("R_executionTooLong")); } }