diff --git a/newsfragments/2418.misc.rst b/newsfragments/2418.misc.rst new file mode 100644 index 0000000000..86392cb2a0 --- /dev/null +++ b/newsfragments/2418.misc.rst @@ -0,0 +1 @@ +Add flaky decorator to Geth gas estimation tests. diff --git a/tests/integration/go_ethereum/common.py b/tests/integration/go_ethereum/common.py index 914160dd04..67802a397e 100644 --- a/tests/integration/go_ethereum/common.py +++ b/tests/integration/go_ethereum/common.py @@ -1,4 +1,14 @@ import pytest +from typing import ( + TYPE_CHECKING, +) + +from eth_typing import ( + ChecksumAddress, +) +from flaky import ( + flaky, +) from web3._utils.module_testing import ( # noqa: F401 AsyncEthModuleTest, @@ -13,6 +23,11 @@ Web3ModuleTest, ) +if TYPE_CHECKING: + from web3 import ( # noqa: F401 + Web3, + ) + class GoEthereumTest(Web3ModuleTest): def _check_web3_clientVersion(self, client_version): @@ -40,6 +55,24 @@ def test_eth_protocol_version(self, w3): def test_eth_protocolVersion(self, w3): super().test_eth_protocolVersion(w3) + @flaky(max_runs=3) + def test_eth_estimate_gas( + self, w3: "Web3", unlocked_account_dual_type: ChecksumAddress + ) -> None: + super().test_eth_estimate_gas(w3, unlocked_account_dual_type) + + @flaky(max_runs=3) + def test_eth_estimateGas_deprecated( + self, w3: "Web3", unlocked_account_dual_type: ChecksumAddress + ) -> None: + super().test_eth_estimateGas_deprecated(w3, unlocked_account_dual_type) + + @flaky(max_runs=3) + def test_eth_estimate_gas_with_block( + self, w3: "Web3", unlocked_account_dual_type: ChecksumAddress + ) -> None: + super().test_eth_estimate_gas_with_block(w3, unlocked_account_dual_type) + class GoEthereumVersionModuleTest(VersionModuleTest): @pytest.mark.xfail(reason='eth_protocolVersion was removed in Geth 1.10.0')