Skip to content

Commit 6d3c05b

Browse files
authored
chore(consume): fix consume sync logger errors. (#2272)
1 parent 90e4ca1 commit 6d3c05b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/pytest_plugins/consume/simulators/simulator_logic/test_via_sync.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,11 +419,17 @@ def test_blockchain_via_sync(
419419
assert eth_rpc is not None, "eth_rpc is required"
420420
assert sync_eth_rpc is not None, "sync_eth_rpc is required"
421421

422-
for attempt in range(3):
422+
for attempt in range(5):
423423
try:
424424
sync_block = sync_eth_rpc.get_block_by_hash(last_valid_block_hash)
425425
client_block = eth_rpc.get_block_by_hash(last_valid_block_hash)
426426

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+
427433
if sync_block["stateRoot"] != client_block["stateRoot"]:
428434
raise LoggedError(
429435
f"State root mismatch after sync. "
@@ -438,8 +444,9 @@ def test_blockchain_via_sync(
438444
f"Expected: {fixture.post_state_hash}, "
439445
f"Got: {sync_block['stateRoot']}"
440446
)
447+
break
441448
except Exception as e:
442-
if attempt < 2:
449+
if attempt < 4:
443450
time.sleep(1)
444451
continue
445452
raise e

0 commit comments

Comments
 (0)