File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/pytest_plugins/consume/simulators/simulator_logic Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -419,11 +419,17 @@ def test_blockchain_via_sync(
419
419
assert eth_rpc is not None , "eth_rpc is required"
420
420
assert sync_eth_rpc is not None , "sync_eth_rpc is required"
421
421
422
- for attempt in range (3 ):
422
+ for attempt in range (5 ):
423
423
try :
424
424
sync_block = sync_eth_rpc .get_block_by_hash (last_valid_block_hash )
425
425
client_block = eth_rpc .get_block_by_hash (last_valid_block_hash )
426
426
427
+ if sync_block is None or client_block is None :
428
+ raise LoggedError (
429
+ f"Failed to retrieve block { last_valid_block_hash } "
430
+ f"on attempt { attempt + 1 } "
431
+ )
432
+
427
433
if sync_block ["stateRoot" ] != client_block ["stateRoot" ]:
428
434
raise LoggedError (
429
435
f"State root mismatch after sync. "
@@ -438,8 +444,9 @@ def test_blockchain_via_sync(
438
444
f"Expected: { fixture .post_state_hash } , "
439
445
f"Got: { sync_block ['stateRoot' ]} "
440
446
)
447
+ break
441
448
except Exception as e :
442
- if attempt < 2 :
449
+ if attempt < 4 :
443
450
time .sleep (1 )
444
451
continue
445
452
raise e
You can’t perform that action at this time.
0 commit comments