You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/10/15 11:03:53 UTC
[incubator-servicecomb-java-chassis] 03/03: [SCB-948] only wait for
start complete for 1 minute
This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git
commit c20ee0303c0ad314855ffc1936b2c794ffebe384
Author: wujimin <wu...@huawei.com>
AuthorDate: Wed Oct 10 16:01:43 2018 +0800
[SCB-948] only wait for start complete for 1 minute
---
.../main/java/org/apache/servicecomb/it/deploy/SubProcessLogger.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/deploy/SubProcessLogger.java b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/deploy/SubProcessLogger.java
index 3e3243f..22ee9bd 100644
--- a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/deploy/SubProcessLogger.java
+++ b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/deploy/SubProcessLogger.java
@@ -98,12 +98,17 @@ public class SubProcessLogger implements Closeable {
}
LOGGER.info("waiting {} start.", displayName);
+ long startTime = System.currentTimeMillis();
for (; ; ) {
if (startCompleted) {
LOGGER.info("{} start completed.", displayName);
return;
}
+ if (System.currentTimeMillis() - startTime > TimeUnit.MINUTES.toMillis(1)) {
+ throw new IllegalStateException(String.format("[%s] timeout to wait for start complete.", displayName));
+ }
+
ITUtils.forceWait(TimeUnit.MILLISECONDS, 500);
}
}