Skip to content

Commit

Permalink
fix testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Nov 26, 2023
1 parent 4cd8403 commit b8ae025
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,7 @@ private DruidPooledConnection getConnectionInternal(long maxWait) throws SQLExce

try {
if (maxWaitThreadCount > 0
&& notEmptyWaitThreadCount >= maxWaitThreadCount) {
&& notEmptyWaitThreadCount > maxWaitThreadCount) {
connectErrorCountUpdater.incrementAndGet(this);
throw new SQLException("maxWaitThreadCount " + maxWaitThreadCount + ", current wait Thread count "
+ lock.getQueueLength());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ public void run() {
Thread.sleep(10);
}

Assert.assertEquals(0, dataSource.getNotEmptyWaitThreadCount());
Assert.assertEquals(1, dataSource.getNotEmptyWaitThreadPeak());
Assert.assertEquals(10, dataSource.getNotEmptyWaitThreadCount());
Assert.assertEquals(10, dataSource.getNotEmptyWaitThreadPeak());

conn.close();

endLatch.await(100, TimeUnit.MILLISECONDS);

Thread.sleep(10);
// Assert.assertEquals(0, dataSource.getNotEmptyWaitThreadCount());
Assert.assertEquals(1, dataSource.getNotEmptyWaitThreadPeak());
Assert.assertEquals(10, dataSource.getNotEmptyWaitThreadPeak());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void run() {
System.out.println(Thread.currentThread() +" "+ LocalDateTime.now() + " getConnection== " + conn);
conn.close();
} catch (Exception e) {
// e.printStackTrace();
e.printStackTrace();
errorCount.incrementAndGet();
} finally {
endLatch.countDown();
Expand Down

0 comments on commit b8ae025

Please sign in to comment.