From 192eb96358befe3bd2505231089277d389d2823f Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Wed, 2 Nov 2022 18:37:23 -0400 Subject: [PATCH] imp: reduce integration test block time to 2s (#1428) --- tests/integration_tests/configs/default.jsonnet | 2 +- tests/integration_tests/test_pruned_node.py | 2 +- tests/integration_tests/test_upgrade.py | 2 +- tests/integration_tests/utils.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/integration_tests/configs/default.jsonnet b/tests/integration_tests/configs/default.jsonnet index deffe43c..e135056f 100644 --- a/tests/integration_tests/configs/default.jsonnet +++ b/tests/integration_tests/configs/default.jsonnet @@ -6,7 +6,7 @@ config: { consensus: { // larger timeout for more stable mempool tests - timeout_commit: '10s', + timeout_commit: '2s', }, mempool: { // use v1 mempool to enable tx prioritization diff --git a/tests/integration_tests/test_pruned_node.py b/tests/integration_tests/test_pruned_node.py index 09206c4c..0dd1e6a3 100644 --- a/tests/integration_tests/test_pruned_node.py +++ b/tests/integration_tests/test_pruned_node.py @@ -45,7 +45,7 @@ def test_pruned_node(pruned): signed = sign_transaction(w3, tx, KEYS["validator"]) txhash = w3.eth.send_raw_transaction(signed.rawTransaction) print("wait for prunning happens") - w3_wait_for_new_blocks(w3, 10) + w3_wait_for_new_blocks(w3, 15) tx_receipt = w3.eth.get_transaction_receipt(txhash.hex()) assert len(tx_receipt.logs) == 1 diff --git a/tests/integration_tests/test_upgrade.py b/tests/integration_tests/test_upgrade.py index ce830e41..18f9d6c3 100644 --- a/tests/integration_tests/test_upgrade.py +++ b/tests/integration_tests/test_upgrade.py @@ -93,7 +93,7 @@ def test_cosmovisor_upgrade(custom_ethermint: Ethermint): """ cli = custom_ethermint.cosmos_cli() height = cli.block_height() - target_height = height + 5 + target_height = height + 10 print("upgrade height", target_height) w3 = custom_ethermint.w3 diff --git a/tests/integration_tests/utils.py b/tests/integration_tests/utils.py index b8c3d7fa..b86c9e95 100644 --- a/tests/integration_tests/utils.py +++ b/tests/integration_tests/utils.py @@ -80,7 +80,7 @@ def wait_for_new_blocks(cli, n): def wait_for_block(cli, height, timeout=240): - for i in range(timeout * 2): + for _ in range(timeout * 2): try: status = cli.status() except AssertionError as e: @@ -96,7 +96,7 @@ def wait_for_block(cli, height, timeout=240): def w3_wait_for_block(w3, height, timeout=240): - for i in range(timeout * 2): + for _ in range(timeout * 2): try: current_height = w3.eth.block_number except Exception as e: