Skip to content

Commit

Permalink
Merge pull request tronprotocol#670 from taihaofu/switch_ports_for_no…
Browse files Browse the repository at this point in the history
…deImplTest

add new ports for nodeImpl related tests to avoid conflicts
  • Loading branch information
huzhenyuan authored May 9, 2018
2 parents 4a629d4 + 26c6e62 commit 21a1719
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/test/java/org/tron/core/net/node/BroadTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ public void run() {

@After
public void destroy() {
Args.clearParam();
FileUtil.deleteDir(new File("output-nodeImplTest"));
peerClient.close();
}

}
6 changes: 4 additions & 2 deletions src/test/java/org/tron/core/net/node/HandleSyncBlockTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public void run() {
logger.info("Full node running.");
Args.setParam(new String[]{"-d",dbPath}, "config.conf");
Args cfgArgs = Args.getInstance();
cfgArgs.setNodeListenPort(17889);
cfgArgs.setNodeListenPort(17891);
cfgArgs.setNodeDiscoveryEnable(false);
cfgArgs.getSeedNode().getIpList().clear();
cfgArgs.setNeedSyncCheck(false);
Expand Down Expand Up @@ -214,7 +214,7 @@ private void prepare() {
mainWorker.shutdownNow();

org.tron.common.overlay.discover.Node node = new Node(
"enode://e437a4836b77ad9d9ffe73ee782ef2614e6d8370fcf62191a6e488276e23717147073a7ce0b444d485fff5a0c34c4577251a7a990cf80d8542e21b95aa8c5e6c@127.0.0.1:17889");
"enode://e437a4836b77ad9d9ffe73ee782ef2614e6d8370fcf62191a6e488276e23717147073a7ce0b444d485fff5a0c34c4577251a7a990cf80d8542e21b95aa8c5e6c@127.0.0.1:17891");
new Thread(new Runnable() {
@Override
public void run() {
Expand Down Expand Up @@ -253,6 +253,8 @@ public void run() {

@After
public void destroy() {
Args.clearParam();
FileUtil.deleteDir(new File("output-nodeImplTest"));
peerClient.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void run() {
logger.info("Full node running.");
Args.setParam(new String[]{"-d", dbPath}, "config.conf");
Args cfgArgs = Args.getInstance();
cfgArgs.setNodeListenPort(17889);
cfgArgs.setNodeListenPort(17890);
cfgArgs.setNodeDiscoveryEnable(false);
cfgArgs.getSeedNode().getIpList().clear();
cfgArgs.setNeedSyncCheck(false);
Expand Down Expand Up @@ -186,7 +186,7 @@ private void prepare() {
mainWorker.shutdownNow();

org.tron.common.overlay.discover.Node node = new Node(
"enode://e437a4836b77ad9d9ffe73ee782ef2614e6d8370fcf62191a6e488276e23717147073a7ce0b444d485fff5a0c34c4577251a7a990cf80d8542e21b95aa8c5e6c@127.0.0.1:17889");
"enode://e437a4836b77ad9d9ffe73ee782ef2614e6d8370fcf62191a6e488276e23717147073a7ce0b444d485fff5a0c34c4577251a7a990cf80d8542e21b95aa8c5e6c@127.0.0.1:17890");
new Thread(new Runnable() {
@Override
public void run() {
Expand Down Expand Up @@ -225,6 +225,8 @@ public void run() {

@After
public void destroy() {
Args.clearParam();
FileUtil.deleteDir(new File("output-nodeImplTest"));
peerClient.close();
}
}

0 comments on commit 21a1719

Please sign in to comment.