You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2020/07/09 03:46:32 UTC
[shardingsphere-elasticjob-lite] branch master updated: Fix job can
not enable for disabled job integrate test sometimes by set timeout.
(#1000)
This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere-elasticjob-lite.git
The following commit(s) were added to refs/heads/master by this push:
new fea53c1 Fix job can not enable for disabled job integrate test sometimes by set timeout. (#1000)
fea53c1 is described below
commit fea53c196f7740b8ff3fe08f0015fdc81d102d44
Author: keker <as...@163.com>
AuthorDate: Thu Jul 9 11:46:22 2020 +0800
Fix job can not enable for disabled job integrate test sometimes by set timeout. (#1000)
---
.../elasticjob/lite/integrate/BaseIntegrateTest.java | 2 +-
.../integrate/disable/ScheduleDisabledJobIntegrateTest.java | 11 +++++------
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/elastic-job-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/BaseIntegrateTest.java b/elastic-job-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/BaseIntegrateTest.java
index 8fc699a..b5d5a3a 100644
--- a/elastic-job-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/BaseIntegrateTest.java
+++ b/elastic-job-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/BaseIntegrateTest.java
@@ -118,7 +118,7 @@ public abstract class BaseIntegrateTest {
private final class TestDistributeOnceElasticJobListener extends AbstractDistributeOnceElasticJobListener {
private TestDistributeOnceElasticJobListener() {
- super(-1L, -1L);
+ super(100L, 100L);
}
@Override
diff --git a/elastic-job-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java b/elastic-job-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java
index a6e731b..d7ab21e 100644
--- a/elastic-job-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java
+++ b/elastic-job-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java
@@ -18,6 +18,7 @@
package org.apache.shardingsphere.elasticjob.lite.integrate.disable;
import org.apache.shardingsphere.elasticjob.lite.api.job.JobConfiguration;
+import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob;
import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry;
import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus;
import org.apache.shardingsphere.elasticjob.lite.util.concurrent.BlockUtils;
@@ -41,10 +42,9 @@ public final class ScheduleDisabledJobIntegrateTest extends DisabledJobIntegrate
BlockUtils.waitingShortTime();
assertDisabledRegCenterInfo();
setJobEnable();
- // TODO the job can not enable sometimes
-// while (!((DetailedFooJob) getElasticJob()).isCompleted()) {
-// BlockUtils.waitingShortTime();
-// }
+ while (!((DetailedFooJob) getElasticJob()).isCompleted()) {
+ BlockUtils.waitingShortTime();
+ }
assertEnabledRegCenterInfo();
}
@@ -55,7 +55,6 @@ public final class ScheduleDisabledJobIntegrateTest extends DisabledJobIntegrate
private void assertEnabledRegCenterInfo() {
assertTrue(getRegCenter().isExisted("/" + getJobName() + "/instances/" + JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId()));
getRegCenter().remove("/" + getJobName() + "/leader/election");
- // TODO the job can not enable sometimes, so can not assert if job not schedule
-// assertTrue(getRegCenter().isExisted("/" + getJobName() + "/sharding"));
+ assertTrue(getRegCenter().isExisted("/" + getJobName() + "/sharding"));
}
}