aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_init.py
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@pm.me>2021-12-10 14:31:01 -0500
committerJames O'Beirne <james.obeirne@pm.me>2021-12-29 13:04:35 -0500
commit24fcf6e435ee53191b1404a11b0689bcd647c9e2 (patch)
tree04d1a9109bfe0ecf440c5b224f8f1b4e78f34c17 /test/functional/feature_init.py
parenta8ffbc01db85d918b8d1406b178b3c6f09123cf1 (diff)
downloadbitcoin-24fcf6e435ee53191b1404a11b0689bcd647c9e2.tar.xz
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.
Diffstat (limited to 'test/functional/feature_init.py')
-rwxr-xr-xtest/functional/feature_init.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/functional/feature_init.py b/test/functional/feature_init.py
index 40468c66e2..a82238f7cf 100755
--- a/test/functional/feature_init.py
+++ b/test/functional/feature_init.py
@@ -152,11 +152,12 @@ class InitStressTest(BitcoinTestFramework):
}
for file_patt, err_fragment in files_to_disturb.items():
- target_file = list(node.chain_path.glob(file_patt))[0]
+ target_files = list(node.chain_path.glob(file_patt))
- self.log.info(f"Tweaking file to ensure failure {target_file}")
- bak_path = str(target_file) + ".bak"
- target_file.rename(bak_path)
+ for target_file in target_files:
+ self.log.info(f"Tweaking file to ensure failure {target_file}")
+ bak_path = str(target_file) + ".bak"
+ target_file.rename(bak_path)
# TODO: at some point, we should test perturbing the files instead of removing
# them, e.g.
@@ -176,8 +177,11 @@ class InitStressTest(BitcoinTestFramework):
match=ErrorMatch.PARTIAL_REGEX,
)
- self.log.info(f"Restoring file from {bak_path} and restarting")
- Path(bak_path).rename(target_file)
+ for target_file in target_files:
+ bak_path = str(target_file) + ".bak"
+ self.log.debug(f"Restoring file from {bak_path} and restarting")
+ Path(bak_path).rename(target_file)
+
check_clean_start()
self.stop_node(0)