Skip to content

Commit

Permalink
#9237 make startThread set shrinkThreshold in the future to guarante…
Browse files Browse the repository at this point in the history
…e at least one idleTimeout period without shrinking

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
  • Loading branch information
lorban committed Mar 28, 2023
1 parent 47247d9 commit c516d00
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -828,21 +828,21 @@ public void testDump() throws Exception
String dump = pool.dump();
// TODO use hamcrest 2.0 regex matcher
assertThat(dump, containsString("STOPPED"));
assertThat(dump, containsString(",3<=0<=4,i=0,r=-1,q=0"));
assertThat(dump, containsString(",3<=0<=4,i=0,r=-1,"));
assertThat(dump, containsString("[NO_TRY]"));

pool.setReservedThreads(2);
dump = pool.dump();
assertThat(dump, containsString("STOPPED"));
assertThat(dump, containsString(",3<=0<=4,i=0,r=2,q=0"));
assertThat(dump, containsString(",3<=0<=4,i=0,r=2,"));
assertThat(dump, containsString("[NO_TRY]"));

pool.start();
waitForIdle(pool, 3);
Thread.sleep(250); // TODO need to give time for threads to read idle poll after setting idle
dump = pool.dump();
assertThat(count(dump, " - STARTED"), is(2));
assertThat(dump, containsString(",3<=3<=4,i=3,r=2,q=0"));
assertThat(dump, containsString(",3<=3<=4,i=3,r=2,"));
assertThat(dump, containsString("[ReservedThreadExecutor@"));
assertThat(count(dump, " IDLE"), is(3));
assertThat(count(dump, " RESERVED"), is(0));
Expand All @@ -865,7 +865,7 @@ public void testDump() throws Exception
Thread.sleep(250); // TODO need to give time for threads to read idle poll after setting idle
dump = pool.dump();
assertThat(count(dump, " - STARTED"), is(2));
assertThat(dump, containsString(",3<=3<=4,i=2,r=2,q=0"));
assertThat(dump, containsString(",3<=3<=4,i=2,r=2,"));
assertThat(dump, containsString("[ReservedThreadExecutor@"));
assertThat(count(dump, " IDLE"), is(2));
assertThat(count(dump, " WAITING"), is(1));
Expand All @@ -875,7 +875,7 @@ public void testDump() throws Exception
pool.setDetailedDump(true);
dump = pool.dump();
assertThat(count(dump, " - STARTED"), is(2));
assertThat(dump, containsString(",3<=3<=4,i=2,r=2,q=0"));
assertThat(dump, containsString(",3<=3<=4,i=2,r=2,"));
assertThat(dump, containsString("reserved=0/2"));
assertThat(dump, containsString("[ReservedThreadExecutor@"));
assertThat(count(dump, " IDLE"), is(2));
Expand All @@ -890,7 +890,7 @@ public void testDump() throws Exception
Thread.sleep(250); // TODO need to give time for threads to read idle poll after setting idle
dump = pool.dump();
assertThat(count(dump, " - STARTED"), is(2));
assertThat(dump, containsString(",3<=3<=4,i=1,r=2,q=0"));
assertThat(dump, containsString(",3<=3<=4,i=1,r=2,"));
assertThat(dump, containsString("reserved=1/2"));
assertThat(dump, containsString("[ReservedThreadExecutor@"));
assertThat(count(dump, " IDLE"), is(1));
Expand Down

0 comments on commit c516d00

Please sign in to comment.