Skip to content

Commit

Permalink
Merge pull request #26738 from brideck/26737-RelaxAbortConnectionsTes…
Browse files Browse the repository at this point in the history
…tTiming

26737: Relax ConnectionPoolStats abortConnections Test Timing
  • Loading branch information
jmstephensgit authored Oct 25, 2023
2 parents a31a155 + c2240d2 commit 6d831b7
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ public void testCountsAfterInUseMultipleSharedAndUnsharedInuseAbortSSArray(HttpS
checkStats(test, dsStatobjName, dsObjectName, expectNumFreePoolConns, expectedNumConnectionHandles, expectedNumManagedConns);
}

Thread.sleep(40); // simulate in use time running a query.
Thread.sleep(60); // simulate in use time running a query.

long creatingConnectionStartSecondSet = System.currentTimeMillis();

Expand Down Expand Up @@ -779,11 +779,11 @@ public void testCountsAfterInUseMultipleSharedAndUnsharedInuseAbortSSArray(HttpS
expectedNumManagedConns = 40;
checkStats(test, dsStatobjName, dsObjectName, expectNumFreePoolConns, expectedNumConnectionHandles, expectedNumManagedConns);

Thread.sleep(40); // simulate in use time running a query.
Thread.sleep(20); // simulate in use time running a query.

int destroyCountBeforeAbort = getMonitorData(dsStatobjName, "DestroyCount");

long testvalue = System.currentTimeMillis() - creatingConnectionStartSecondSet + 20;
long testvalue = System.currentTimeMillis() - creatingConnectionStartSecondSet + 40;
String abortInfo = (String) mbeanServer.invoke(dsObjectName.getObjectName(), "abortConnections", new Object[] { "inuse", testvalue }, null);
String expectedString1 = "20 in use connections added to the in use abort list";
String expectedString2 = "10 free connections not added to the in use abort list";
Expand Down Expand Up @@ -849,7 +849,7 @@ public void testCountsAfterInUseMultipleSharedAndUnsharedInuseAbortSSCloseFSShar
checkStats(test, dsStatobjName, dsObjectName, expectNumFreePoolConns, expectedNumConnectionHandles, expectedNumManagedConns);
}

Thread.sleep(40); // simulate in use time running a query.
Thread.sleep(60); // simulate in use time running a query.

long creatingConnectionStartSecondSet = System.currentTimeMillis();

Expand Down Expand Up @@ -894,11 +894,11 @@ public void testCountsAfterInUseMultipleSharedAndUnsharedInuseAbortSSCloseFSShar
expectedNumManagedConns = 40;
checkStats(test, dsStatobjName, dsObjectName, expectNumFreePoolConns, expectedNumConnectionHandles, expectedNumManagedConns);

Thread.sleep(40); // simulate in use time running a query.
Thread.sleep(20); // simulate in use time running a query.

int destroyCountBeforeAbort = getMonitorData(dsStatobjName, "DestroyCount");

long testvalue = System.currentTimeMillis() - creatingConnectionStartSecondSet + 20;
long testvalue = System.currentTimeMillis() - creatingConnectionStartSecondSet + 40;
String abortInfo = (String) mbeanServer.invoke(dsObjectName.getObjectName(), "abortConnections", new Object[] { "inuse", testvalue }, null);
String expectedString1 = "20 in use connections added to the in use abort list";
String expectedString2 = "10 free connections not added to the in use abort list";
Expand Down Expand Up @@ -964,7 +964,7 @@ public void testCountsAfterInUseMultipleSharedAndUnsharedInuseAbortFSArray(HttpS
checkStats(test, dsStatobjName, dsObjectName, expectNumFreePoolConns, expectedNumConnectionHandles, expectedNumManagedConns);
}

Thread.sleep(40); // simulate in use time running a query.
Thread.sleep(60); // simulate in use time running a query.

long creatingConnectionStartSecondSet = System.currentTimeMillis();

Expand Down Expand Up @@ -1001,11 +1001,11 @@ public void testCountsAfterInUseMultipleSharedAndUnsharedInuseAbortFSArray(HttpS
expectedNumManagedConns = 40;
checkStats(test, dsStatobjName, dsObjectName, expectNumFreePoolConns, expectedNumConnectionHandles, expectedNumManagedConns);

Thread.sleep(40); // simulate in use time running a query.
Thread.sleep(20); // simulate in use time running a query.

int destroyCountBeforeAbort = getMonitorData(dsStatobjName, "DestroyCount");

long testvalue = System.currentTimeMillis() - creatingConnectionStartSecondSet + 20;
long testvalue = System.currentTimeMillis() - creatingConnectionStartSecondSet + 40;
String abortInfo = (String) mbeanServer.invoke(dsObjectName.getObjectName(), "abortConnections", new Object[] { "inuse", testvalue }, null);
String expectedString1 = "10 in use connections added to the in use abort list";
String expectedString2 = "10 free connections not added to the in use abort list";
Expand Down

0 comments on commit 6d831b7

Please sign in to comment.