Skip to content

Commit 2cd75fd

Browse files
authored
Add flaky decorator to geth estimate_gas (ethereum#2418)
* Add flaky decorator to geth gas estimation tests * Add newsfragment
1 parent 827e2e3 commit 2cd75fd

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

newsfragments/2418.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add flaky decorator to Geth gas estimation tests.

tests/integration/go_ethereum/common.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
import pytest
2+
from typing import (
3+
TYPE_CHECKING,
4+
)
5+
6+
from eth_typing import (
7+
ChecksumAddress,
8+
)
9+
from flaky import (
10+
flaky,
11+
)
212

313
from web3._utils.module_testing import ( # noqa: F401
414
AsyncEthModuleTest,
@@ -13,6 +23,11 @@
1323
Web3ModuleTest,
1424
)
1525

26+
if TYPE_CHECKING:
27+
from web3 import ( # noqa: F401
28+
Web3,
29+
)
30+
1631

1732
class GoEthereumTest(Web3ModuleTest):
1833
def _check_web3_clientVersion(self, client_version):
@@ -40,6 +55,24 @@ def test_eth_protocol_version(self, w3):
4055
def test_eth_protocolVersion(self, w3):
4156
super().test_eth_protocolVersion(w3)
4257

58+
@flaky(max_runs=3)
59+
def test_eth_estimate_gas(
60+
self, w3: "Web3", unlocked_account_dual_type: ChecksumAddress
61+
) -> None:
62+
super().test_eth_estimate_gas(w3, unlocked_account_dual_type)
63+
64+
@flaky(max_runs=3)
65+
def test_eth_estimateGas_deprecated(
66+
self, w3: "Web3", unlocked_account_dual_type: ChecksumAddress
67+
) -> None:
68+
super().test_eth_estimateGas_deprecated(w3, unlocked_account_dual_type)
69+
70+
@flaky(max_runs=3)
71+
def test_eth_estimate_gas_with_block(
72+
self, w3: "Web3", unlocked_account_dual_type: ChecksumAddress
73+
) -> None:
74+
super().test_eth_estimate_gas_with_block(w3, unlocked_account_dual_type)
75+
4376

4477
class GoEthereumVersionModuleTest(VersionModuleTest):
4578
@pytest.mark.xfail(reason='eth_protocolVersion was removed in Geth 1.10.0')

0 commit comments

Comments
 (0)