Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: test_tx_inclusion is flaky when nodes halt due to different gas_wanted #1657

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions integration_tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ def fn(cmd):
lambda cmd: fn(cmd),
)
cronos.supervisorctl("update")
time.sleep(2)
wait_for_port(ports.evmrpc_port(cronos.base_port(0)))

# reset to origin_cmd only
Expand Down
5 changes: 4 additions & 1 deletion integration_tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,14 @@ def wait_for_block(cli, height, timeout=240):
raise TimeoutError(f"wait for block {height} timeout")


def wait_for_new_blocks(cli, n, sleep=0.5):
def wait_for_new_blocks(cli, n, sleep=0.5, timeout=240):
cur_height = begin_height = int(get_sync_info(cli.status())["latest_block_height"])
start_time = time.time()
while cur_height - begin_height < n:
time.sleep(sleep)
cur_height = int(get_sync_info(cli.status())["latest_block_height"])
if time.time() - start_time > timeout:
raise TimeoutError(f"wait for block {begin_height + n} timeout")
return cur_height


Expand Down
Loading