Compare commits

...

2 Commits

Author SHA1 Message Date
0g-peterzhb
041b03c38d
Merge deb587a9e8 into f21d691812 2024-11-21 10:34:13 +08:00
Peter Zhang
deb587a9e8 refactor snapshot test 2024-11-19 11:48:47 +08:00

View File

@ -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) is not None)
wait_until(lambda: self.nodes[1].zgs_get_file_info(data_root_1)["finalized"]) wait_until(lambda: self.nodes[1].zgs_get_file_info(data_root_1)["finalized"])
# Start the last node to verify historical file sync # Stop the last node to remove entire db folder and copy the flow_db (snapshot) from the first node
self.nodes[1].shutdown() self.stop_storage_node(1, clean=True)
shutil.rmtree(os.path.join(self.nodes[1].data_dir, 'db/data_db')) 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.start_storage_node(1)
self.nodes[1].wait_for_rpc_connection() self.nodes[1].wait_for_rpc_connection()