Skip to content

Commit 24fcf6e

Browse files
committed
test: feature_init: tweak all .ldb files of a certain type
This part of the test sporadically fails on CI infrastructure. Instead of perturbing a single .ldb file of each type, move all .ldb files of a given type to ensure a bad startup.
1 parent a8ffbc0 commit 24fcf6e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

test/functional/feature_init.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,12 @@ def check_clean_start():
152152
}
153153

154154
for file_patt, err_fragment in files_to_disturb.items():
155-
target_file = list(node.chain_path.glob(file_patt))[0]
155+
target_files = list(node.chain_path.glob(file_patt))
156156

157-
self.log.info(f"Tweaking file to ensure failure {target_file}")
158-
bak_path = str(target_file) + ".bak"
159-
target_file.rename(bak_path)
157+
for target_file in target_files:
158+
self.log.info(f"Tweaking file to ensure failure {target_file}")
159+
bak_path = str(target_file) + ".bak"
160+
target_file.rename(bak_path)
160161

161162
# TODO: at some point, we should test perturbing the files instead of removing
162163
# them, e.g.
@@ -176,8 +177,11 @@ def check_clean_start():
176177
match=ErrorMatch.PARTIAL_REGEX,
177178
)
178179

179-
self.log.info(f"Restoring file from {bak_path} and restarting")
180-
Path(bak_path).rename(target_file)
180+
for target_file in target_files:
181+
bak_path = str(target_file) + ".bak"
182+
self.log.debug(f"Restoring file from {bak_path} and restarting")
183+
Path(bak_path).rename(target_file)
184+
181185
check_clean_start()
182186
self.stop_node(0)
183187

0 commit comments

Comments
 (0)