From e4fa6b8cb550e4b5dabfff5e33c446ff0e7c627c Mon Sep 17 00:00:00 2001 From: halibobo1205 Date: Mon, 17 Jun 2024 18:20:33 +0800 Subject: [PATCH] fix(test): exit with 1. --- .../org/tron/core/metrics/MetricsApiServiceTest.java | 2 +- .../src/test/java/org/tron/core/net/BaseNet.java | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/framework/src/test/java/org/tron/core/metrics/MetricsApiServiceTest.java b/framework/src/test/java/org/tron/core/metrics/MetricsApiServiceTest.java index db05044f2ca..e36029c6141 100644 --- a/framework/src/test/java/org/tron/core/metrics/MetricsApiServiceTest.java +++ b/framework/src/test/java/org/tron/core/metrics/MetricsApiServiceTest.java @@ -44,7 +44,7 @@ public void init() throws IOException { "--storage-db-directory", dbDirectory, "--storage-index-directory", indexDirectory }, - "config.conf" + Constant.TEST_CONF ); CommonParameter parameter = Args.getInstance(); parameter.setNodeListenPort(port); diff --git a/framework/src/test/java/org/tron/core/net/BaseNet.java b/framework/src/test/java/org/tron/core/net/BaseNet.java index 7ae8b355168..65771bae952 100644 --- a/framework/src/test/java/org/tron/core/net/BaseNet.java +++ b/framework/src/test/java/org/tron/core/net/BaseNet.java @@ -30,12 +30,12 @@ import org.tron.common.application.TronApplicationContext; import org.tron.common.parameter.CommonParameter; import org.tron.common.utils.FileUtil; +import org.tron.common.utils.PublicMethod; import org.tron.common.utils.ReflectUtils; import org.tron.core.Constant; import org.tron.core.config.DefaultConfig; import org.tron.core.config.args.Args; import org.tron.core.net.peer.PeerConnection; -import org.tron.core.services.RpcApiService; @Slf4j public class BaseNet { @@ -48,7 +48,6 @@ public class BaseNet { protected static TronApplicationContext context; - private static RpcApiService rpcApiService; private static Application appT; private static TronNetDelegate tronNetDelegate; @@ -98,10 +97,15 @@ public static void init() throws Exception { parameter.setNodeListenPort(port); parameter.getSeedNode().getAddressList().clear(); parameter.setNodeExternalIp(Constant.LOCAL_HOST); + parameter.setRpcEnable(true); + parameter.setRpcPort(PublicMethod.chooseRandomPort()); + parameter.setRpcSolidityEnable(false); + parameter.setRpcPBFTEnable(false); + parameter.setFullNodeHttpEnable(false); + parameter.setSolidityNodeHttpEnable(false); + parameter.setPBFTHttpEnable(false); context = new TronApplicationContext(DefaultConfig.class); appT = ApplicationFactory.create(context); - rpcApiService = context.getBean(RpcApiService.class); - appT.addService(rpcApiService); appT.startup(); try { Thread.sleep(2000);