Skip to content

Commit e2a28de

Browse files
authored
test: fix flaky ibc and versiondb integration tests (#2071)
* test: fix flaky ibc and versiondb integration tests * add changelog * fmt
1 parent 087eaf5 commit e2a28de

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* [#2068](https://github.com/crypto-org-chain/cronos/pull/2068) fix(ante): enforce eip-1559 cost balance check even if it is not checkTx.
2525
* [#2070](https://github.com/crypto-org-chain/cronos/pull/2070) fix(ci): fix github pr labeler to match v6 format.
2626
* [#2069](https://github.com/crypto-org-chain/cronos/pull/2069) fix(test): flaky test_mempool integration test.
27+
* [#2071](https://github.com/crypto-org-chain/cronos/pull/2071) fix(test): fix flaky ibc and versiondb integration tests.
2728

2829
### Chores:
2930
* [#1986](https://github.com/crypto-org-chain/cronos/pull/1986) Remove unused precompiles

integration_tests/ibc_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,7 @@ def check_tx():
775775
if timeout is None:
776776
wait_for_fn("transfer tx", check_tx)
777777
else:
778+
raised = False
778779
try:
779780
print(f"should assert timeout err when pass {timeout}s")
780781
wait_for_fn("transfer tx", check_tx, timeout=timeout)
@@ -793,6 +794,7 @@ def check_status():
793794
if timeout is None:
794795
wait_for_fn("current status", check_status)
795796
else:
797+
raised = False
796798
try:
797799
print(f"should assert timeout err when pass {timeout}s")
798800
wait_for_fn("current status", check_status, timeout=timeout)

integration_tests/test_versiondb.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
from pystarport import ports
66

77
from .network import Cronos
8-
from .utils import ADDRS, send_transaction, w3_wait_for_new_blocks, wait_for_port
8+
from .utils import (
9+
ADDRS,
10+
send_transaction,
11+
w3_wait_for_block,
12+
w3_wait_for_new_blocks,
13+
wait_for_port,
14+
)
915

1016

1117
def test_versiondb_migration(cronos: Cronos):
@@ -85,6 +91,10 @@ def test_versiondb_migration(cronos: Cronos):
8591
)
8692
for i in range(len(cronos.config["validators"])):
8793
wait_for_port(ports.evmrpc_port(cronos.base_port(i)))
94+
# wait for consensus to be stable after restart
95+
w3_wait_for_new_blocks(w3, 2)
96+
# ensure the node has replayed up to block1 before historical queries
97+
w3_wait_for_block(w3, block1)
8898

8999
assert w3.eth.get_balance(community, block_identifier=block0) == balance0
90100
assert w3.eth.get_balance(community, block_identifier=block1) == balance1

0 commit comments

Comments
 (0)