@@ -54,11 +54,13 @@ def start_expecting_error(err_fragment, args):
54
54
match = ErrorMatch .PARTIAL_REGEX ,
55
55
)
56
56
57
- def check_clean_start ():
57
+ def check_clean_start (extra_args ):
58
58
"""Ensure that node restarts successfully after various interrupts."""
59
- node .start ()
59
+ node .start (extra_args )
60
60
node .wait_for_rpc_connection ()
61
- assert_equal (200 , node .getblockcount ())
61
+ height = node .getblockcount ()
62
+ assert_equal (200 , height )
63
+ self .wait_until (lambda : all (i ["synced" ] and i ["best_block_height" ] == height for i in node .getindexinfo ().values ()))
62
64
63
65
lines_to_terminate_after = [
64
66
b'Validating signatures for all blocks' ,
@@ -97,7 +99,9 @@ def check_clean_start():
97
99
self .log .debug ("Terminating node after terminate line was found" )
98
100
sigterm_node ()
99
101
100
- check_clean_start ()
102
+ # Prior to deleting/perturbing index files, start node with all indexes enabled.
103
+ # 'check_clean_start' will ensure indexes are synchronized (i.e., data exists to modify)
104
+ check_clean_start (args )
101
105
self .stop_node (0 )
102
106
103
107
self .log .info ("Test startup errors after removing certain essential files" )
@@ -186,7 +190,7 @@ def check_clean_start():
186
190
self .log .debug (f"Restoring file from { bak_path } and restarting" )
187
191
Path (bak_path ).rename (target_file )
188
192
189
- check_clean_start ()
193
+ check_clean_start (args )
190
194
self .stop_node (0 )
191
195
192
196
self .log .info ("Test startup errors after perturbing certain essential files" )
0 commit comments