Skip to content

Commit

Permalink
fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
yanhom1314 committed Feb 10, 2025
1 parent 0625c53 commit 4d6925b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ class ApolloRefresherTest extends DtpBaseTest {
@Test
void testRefresh() throws InterruptedException {
int corePoolSize = context.getBean("dtpExecutor1", ThreadPoolExecutor.class).getCorePoolSize();
System.out.println(corePoolSize);
System.out.println("apollo refresher, corePoolSize before refresh: " + corePoolSize);
Assertions.assertEquals(6, corePoolSize);
mockConfigChange();
Thread.sleep(6000L);
corePoolSize = context.getBean("dtpExecutor1", ThreadPoolExecutor.class).getCorePoolSize();
System.out.println(corePoolSize);
System.out.println("apollo refresher, corePoolSize after refresh: " + corePoolSize);
Assertions.assertEquals(10, corePoolSize);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@
class CloudRefresherTest extends DtpBaseTest {

@Test
void testCloudRefresh() {
void testCloudRefresh() throws InterruptedException {
int corePoolSize = context.getBean("dtpExecutor1", ThreadPoolExecutor.class).getCorePoolSize();
System.out.println(corePoolSize);
System.out.println("corePoolSize before refresh: " + corePoolSize);
Assertions.assertEquals(6, corePoolSize);
mockEnvironmentChange();
Thread.sleep(2000L);
corePoolSize = context.getBean("dtpExecutor1", ThreadPoolExecutor.class).getCorePoolSize();
System.out.println(corePoolSize);
System.out.println("corePoolSize after refresh: " + corePoolSize);
Assertions.assertEquals(10, corePoolSize);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ void testRefresh() throws InterruptedException {
assert context.containsBean("dtpExecutor1") : "dtpExecutor1 bean not found!";

int corePoolSize = context.getBean("dtpExecutor1", ThreadPoolExecutor.class).getCorePoolSize();
System.out.println(corePoolSize);
System.out.println("nacos refresher, corePoolSize before refresh: " + corePoolSize);
Assertions.assertEquals(6, corePoolSize);
mockConfigChange();
Thread.sleep(2000L);
corePoolSize = context.getBean("dtpExecutor1", ThreadPoolExecutor.class).getCorePoolSize();
System.out.println(corePoolSize);
System.out.println("nacos refresher, corePoolSize after refresh: " + corePoolSize);
Assertions.assertEquals(10, corePoolSize);
}

Expand Down

0 comments on commit 4d6925b

Please sign in to comment.