From deb587a9e8c236bbb7708f6207741f238449442f Mon Sep 17 00:00:00 2001 From: Peter Zhang Date: Tue, 19 Nov 2024 11:43:36 +0800 Subject: [PATCH] refactor snapshot test --- tests/snapshot_test.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/snapshot_test.py b/tests/snapshot_test.py index dc31c35..158dfde 100644 --- a/tests/snapshot_test.py +++ b/tests/snapshot_test.py @@ -26,10 +26,11 @@ class SnapshotTask(TestFramework): wait_until(lambda: self.nodes[1].zgs_get_file_info(data_root_1) is not None) wait_until(lambda: self.nodes[1].zgs_get_file_info(data_root_1)["finalized"]) - # Start the last node to verify historical file sync - self.nodes[1].shutdown() - shutil.rmtree(os.path.join(self.nodes[1].data_dir, 'db/data_db')) - + # Stop the last node to remove entire db folder and copy the flow_db (snapshot) from the first node + self.stop_storage_node(1, clean=True) + shutil.copytree(os.path.join(self.nodes[0].data_dir, 'db/flow_db'), os.path.join(self.nodes[1].data_dir, 'db/flow_db')) + + # Start the last node to verify snapshot sync self.start_storage_node(1) self.nodes[1].wait_for_rpc_connection()