diff --git a/package/test_tools/__private/node.py b/package/test_tools/__private/node.py index 23cff866bcdc4c7e21d822be770f460648743cff..c7453e6b4e7ef8eb6250b8d22f08f4c3839df387 100644 --- a/package/test_tools/__private/node.py +++ b/package/test_tools/__private/node.py @@ -91,6 +91,16 @@ class Node(RunnableHandle[NodeProcess, NodeConfig, NodeArguments, Settings], Bas def directory(self) -> Path: return self.settings.ensured_working_directory + @property + def shared_file_path(self) -> Path: + shm_path = None + if self.config.shared_file_dir is not None: + shm_path = Path(str(self.config.shared_file_dir)) + else: + shm_path = self.directory / "state" / "mmapfiles" + + return shm_path / "shared_memory.bin" + def _get_settings(self) -> Settings: return self.settings @@ -570,7 +580,7 @@ class Node(RunnableHandle[NodeProcess, NodeConfig, NodeArguments, Settings], Bas def __remove_unneeded_files(self) -> None: unneeded_files_or_directories = [ - "blockchain/shared_memory.bin", + str(self.shared_file_path), "snapshot/", ] @@ -585,7 +595,7 @@ class Node(RunnableHandle[NodeProcess, NodeConfig, NodeArguments, Settings], Bas self.__remove(unneeded_file) def __register_rocksdb_data_to_remove(self, unneeded_files_or_directories: list[str]) -> None: - rocksdb_directory = self.directory.joinpath("blockchain/account-history-rocksdb-storage") + rocksdb_directory = self.directory.joinpath("state/rocksdb/account-history-rocksdb-storage") if not rocksdb_directory: return diff --git a/package/test_tools/__private/user_handles/handles/node_handles/runnable_node_handle.py b/package/test_tools/__private/user_handles/handles/node_handles/runnable_node_handle.py index 3c6ecd6efcc1d10e1029c73eb02e41aef88d5e66..17c0c666c7dfb35a4a07866bee1988753bf3b11f 100644 --- a/package/test_tools/__private/user_handles/handles/node_handles/runnable_node_handle.py +++ b/package/test_tools/__private/user_handles/handles/node_handles/runnable_node_handle.py @@ -52,6 +52,11 @@ class RunnableNodeHandle(NodeHandleBase): """Returns path to directory, where node runs and generates its files.""" return self.__implementation.directory + @property + def shared_file_path(self) -> Path: + """Returns path to directory, where node stores its shared memory file.""" + return self.__implementation.shared_file_path + def dump_config(self) -> NodeConfig: """Saves node's config to file and returns it as object. Requires that node is not running.""" return self.__implementation.dump_config()