Skip to content

Commit 21e61a3

Browse files
committed
feat: add cleanup commands for container databases and logs on stop
1 parent 3428083 commit 21e61a3

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

resilience/src/test/java/com/arcadedb/containers/support/ContainersTestTemplate.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,15 @@ protected void stopContainers() {
123123
containers.stream()
124124
.filter(ContainerState::isRunning)
125125
.peek(container -> logger.info("Stopping container {}", container.getContainerName()))
126+
.peek(container-> {
127+
try {
128+
container.execInContainer("rm -rf", "/home/arcadedb/databases/*");
129+
container.execInContainer("rm -rf", "/home/arcadedb/replication/*");
130+
container.execInContainer("rm -rf", "/home/arcadedb/logs/*");
131+
} catch (IOException | InterruptedException e ) {
132+
logger.error("Error while stopping container {}", container.getContainerName(), e);
133+
}
134+
})
126135
.forEach(GenericContainer::stop);
127136
containers.clear();
128137
}

0 commit comments

Comments
 (0)