Skip to content

Commit

Permalink
fix(test): exit with 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
halibobo1205 committed Jun 17, 2024
1 parent 76f0488 commit e4fa6b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 8 additions & 4 deletions framework/src/test/java/org/tron/core/net/BaseNet.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -48,7 +48,6 @@ public class BaseNet {

protected static TronApplicationContext context;

private static RpcApiService rpcApiService;
private static Application appT;
private static TronNetDelegate tronNetDelegate;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit e4fa6b8

Please sign in to comment.