Skip to content

Commit

Permalink
Relax the conditions for unit tests involving awaitility to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
linghengqian committed Oct 14, 2023
1 parent 4754f91 commit 40b03c2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public DisabledJobIntegrateTest(final TestType type) {
}

protected final void assertDisabledRegCenterInfo() {
Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> {
Awaitility.await().atLeast(1L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> {
assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount(getJobName()), is(3));
assertThat(JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), is(IpUtils.getIp()));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ void tearDown() {
void jobScriptWithJobTypeTest() {
OneOffJobBootstrap bootstrap = applicationContext.getBean(scriptJobName, OneOffJobBootstrap.class);
bootstrap.execute();
Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertTrue(regCenter.isExisted("/" + scriptJobName + "/sharding")));
Awaitility.await().atLeast(1L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertTrue(regCenter.isExisted("/" + scriptJobName + "/sharding")));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void assertSpringJobBean() {
}

private void assertSimpleElasticJobBean() {
Awaitility.await().atMost(5L, TimeUnit.SECONDS).untilAsserted(() -> assertThat(AnnotationSimpleJob.isCompleted(), is(true)));
Awaitility.await().atMost(10L, TimeUnit.SECONDS).untilAsserted(() -> assertThat(AnnotationSimpleJob.isCompleted(), is(true)));
assertTrue(AnnotationSimpleJob.isCompleted());
assertTrue(regCenter.isExisted("/" + simpleJobName + "/sharding"));
}
Expand Down

0 comments on commit 40b03c2

Please sign in to comment.