This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 947e67fa76 [enhancement](test) retry start be or fe when port has been
bind. (#13860)
947e67fa76 is described below
commit 947e67fa76a6904efde7227e935f00fe1a321b3a
Author: wxy <[email protected]>
AuthorDate: Wed Nov 2 08:42:35 2022 +0800
[enhancement](test) retry start be or fe when port has been bind. (#13860)
Co-authored-by: [email protected] <[email protected]>
---
.../org/apache/doris/utframe/UtFrameUtils.java | 27 +++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/utframe/UtFrameUtils.java
b/fe/fe-core/src/test/java/org/apache/doris/utframe/UtFrameUtils.java
index 7e048e116c..adc5a86a39 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/utframe/UtFrameUtils.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/utframe/UtFrameUtils.java
@@ -149,6 +149,19 @@ public class UtFrameUtils {
public static int startFEServer(String runningDir) throws
EnvVarNotSetException, IOException,
FeStartException, NotInitException, DdlException,
InterruptedException {
+ IOException exception = null;
+ for (int i = 0; i <= 3; i++) {
+ try {
+ return startFEServerWithoutRetry(runningDir);
+ } catch (IOException ignore) {
+ exception = ignore;
+ }
+ }
+ throw exception;
+ }
+
+ private static int startFEServerWithoutRetry(String runningDir) throws
EnvVarNotSetException, IOException,
+ FeStartException, NotInitException {
// get DORIS_HOME
String dorisHome = System.getenv("DORIS_HOME");
if (Strings.isNullOrEmpty(dorisHome)) {
@@ -232,6 +245,18 @@ public class UtFrameUtils {
}
public static Backend createBackend(String beHost, int feRpcPort) throws
IOException, InterruptedException {
+ IOException exception = null;
+ for (int i = 0; i <= 3; i++) {
+ try {
+ return createBackendWithoutRetry(beHost, feRpcPort);
+ } catch (IOException ignore) {
+ exception = ignore;
+ }
+ }
+ throw exception;
+ }
+
+ private static Backend createBackendWithoutRetry(String beHost, int
feRpcPort) throws IOException {
int beHeartbeatPort = findValidPort();
int beThriftPort = findValidPort();
int beBrpcPort = findValidPort();
@@ -240,7 +265,7 @@ public class UtFrameUtils {
// start be
MockedBackend backend = MockedBackendFactory.createBackend(beHost,
beHeartbeatPort, beThriftPort, beBrpcPort,
beHttpPort, new DefaultHeartbeatServiceImpl(beThriftPort,
beHttpPort, beBrpcPort),
- new DefaultBeThriftServiceImpl(), new
DefaultPBackendServiceImpl());
+ new DefaultBeThriftServiceImpl(), new
DefaultPBackendServiceImpl());
backend.setFeAddress(new TNetworkAddress("127.0.0.1", feRpcPort));
backend.start();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]