diff --git a/scripts/db-heal-test.py b/scripts/db-heal-test.py index a277ad0ba..7cc9749a7 100644 --- a/scripts/db-heal-test.py +++ b/scripts/db-heal-test.py @@ -145,6 +145,7 @@ def check_aida_log(process, sleep_time, log_path): def get_latest_checkpoint_from_info(log_path): log = os.path.join(working_dir, log_path) cp: str + checkpoint_keyword = 'Checkpoint: ' with open(log, 'w') as cl: r = subprocess.run( ['go', 'run', './database/mpt/tool', 'info', str(archive)], @@ -155,10 +156,11 @@ def get_latest_checkpoint_from_info(log_path): return -1 with open(log, 'r') as cl: - info_checkpoint = cl.readlines()[-1] - # Return last word which is the block number - cp = info_checkpoint.split()[-1] - + for line in cl: + if checkpoint_keyword in line: + start_index = line.find(checkpoint_keyword) + len(checkpoint_keyword) + cp = line[start_index:].strip() + break return int(cp)