Skip to content

Commit 6310814

Browse files
committed
Clean up Besu runtime files when stopping ATs
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
1 parent be24baf commit 6310814

File tree

1 file changed

+15
-0
lines changed
  • acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node

1 file changed

+15
-0
lines changed

acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,21 @@ public void stop() {
786786
nodeRequests.shutdown();
787787
nodeRequests = null;
788788
}
789+
790+
deleteRuntimeFiles();
791+
}
792+
793+
private void deleteRuntimeFiles() {
794+
try {
795+
Files.deleteIfExists(homeDirectory.resolve("besu.networks"));
796+
} catch (IOException e) {
797+
LOG.error("Failed to clean up besu.networks file in {}", homeDirectory, e);
798+
}
799+
try {
800+
Files.deleteIfExists(homeDirectory.resolve("besu.ports"));
801+
} catch (IOException e) {
802+
LOG.error("Failed to clean up besu.ports file in {}", homeDirectory, e);
803+
}
789804
}
790805

791806
@Override

0 commit comments

Comments
 (0)