@ -152,11 +152,12 @@ class InitStressTest(BitcoinTestFramework):
}
}
for file_patt , err_fragment in files_to_disturb . items ( ) :
for file_patt , err_fragment in files_to_disturb . items ( ) :
target_file = list ( node . chain_path . glob ( file_patt ) ) [ 0 ]
target_file s = list ( node . chain_path . glob ( file_patt ) )
self . log . info ( f " Tweaking file to ensure failure { target_file } " )
for target_file in target_files :
bak_path = str ( target_file ) + " .bak "
self . log . info ( f " Tweaking file to ensure failure { target_file } " )
target_file . rename ( bak_path )
bak_path = str ( target_file ) + " .bak "
target_file . rename ( bak_path )
# TODO: at some point, we should test perturbing the files instead of removing
# TODO: at some point, we should test perturbing the files instead of removing
# them, e.g.
# them, e.g.
@ -176,8 +177,11 @@ class InitStressTest(BitcoinTestFramework):
match = ErrorMatch . PARTIAL_REGEX ,
match = ErrorMatch . PARTIAL_REGEX ,
)
)
self . log . info ( f " Restoring file from { bak_path } and restarting " )
for target_file in target_files :
Path ( bak_path ) . rename ( target_file )
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 ( )
check_clean_start ( )
self . stop_node ( 0 )
self . stop_node ( 0 )