mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@647 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -26,8 +26,8 @@ public class TestIdle3_Concurrent_Starvation extends TestCase {
|
||||
dataSource.setUrl("jdbc:mock:xxx");
|
||||
dataSource.setDriver(driver);
|
||||
dataSource.setInitialSize(1);
|
||||
dataSource.setMaxActive(14);
|
||||
dataSource.setMaxIdle(14);
|
||||
dataSource.setMaxActive(100);
|
||||
dataSource.setMaxIdle(100);
|
||||
dataSource.setMinIdle(1);
|
||||
dataSource.setMinEvictableIdleTimeMillis(300 * 1000); // 300 / 10
|
||||
dataSource.setTimeBetweenEvictionRunsMillis(180 * 1000); // 180 / 10
|
||||
@@ -61,7 +61,7 @@ public class TestIdle3_Concurrent_Starvation extends TestCase {
|
||||
}
|
||||
|
||||
for (int i = 0; i < 1; ++i) {
|
||||
final int threadCount = 10;
|
||||
final int threadCount = 100;
|
||||
concurrent(threadCount);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public class TestIdle3_Concurrent_Starvation extends TestCase {
|
||||
dataSource.shrink(false);
|
||||
Assert.assertEquals(0, dataSource.getActiveCount());
|
||||
Assert.assertEquals(dataSource.getMinIdle(), dataSource.getPoolingCount());
|
||||
if (pass.getAndIncrement() % 10000 == 0) {
|
||||
if (pass.getAndIncrement() % 100 == 0) {
|
||||
System.out.println("pass : " + pass.get());
|
||||
}
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public class TestIdle3_Concurrent_Starvation extends TestCase {
|
||||
public void run() {
|
||||
try {
|
||||
startLatch.await();
|
||||
for (int i = 0; i < 1000 * 1000; ++i) {
|
||||
for (int i = 0; i < 1000 * 1; ++i) {
|
||||
|
||||
Connection conn = dataSource.getConnection();
|
||||
closeBarrier.await();
|
||||
|
||||
Reference in New Issue
Block a user