Skip to content

Add flaky decorator to geth estimate_gas #2418

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

Merged
merged 4 commits into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from all 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 newsfragments/2418.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add flaky decorator to Geth gas estimation tests.
33 changes: 33 additions & 0 deletions tests/integration/go_ethereum/common.py
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -13,6 +23,11 @@
Web3ModuleTest,
)

if TYPE_CHECKING:
from web3 import ( # noqa: F401
Web3,
)


class GoEthereumTest(Web3ModuleTest):
def _check_web3_clientVersion(self, client_version):
Expand Down Expand Up @@ -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')
Expand Down