Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public static void checkActiveDatabases(final boolean drop) {

public static void deleteDatabaseFolders(final int totalServers) {
FileUtils.deleteRecursively(new File("./target/databases/"));
FileUtils.deleteRecursively(new File("./target/config/"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The method deleteDatabaseFolders now deletes configuration files in addition to database folders. This introduces a side effect that is not reflected in the method's name, which can be misleading for other developers and may lead to unexpected behavior if a test intends to preserve configuration while resetting databases. Consider renaming the method to something more descriptive, such as cleanupTestArtifacts, or moving this logic to a dedicated cleanup method. Additionally, hardcoding the path ./target/config/ makes the cleanup logic fragile as it assumes a specific project structure and working directory.

FileUtils.deleteRecursively(new File(GlobalConfiguration.SERVER_DATABASE_DIRECTORY.getValueAsString() + File.separator));
for (int i = 0; i < totalServers; ++i)
FileUtils.deleteRecursively(new File(GlobalConfiguration.SERVER_DATABASE_DIRECTORY.getValueAsString() + i + File.separator));
Expand Down
Loading