Skip to content

Commit b99cb18

Browse files
committed
Help flaky tests pass with the right conditions:
- We recently removed the specific flaky xfail markers from some replace transaction tests. They now sometimes fail with "nonce too low", which is better than the previous timeout issues. We should add the flaky_geth_dev_mining decorator to these so they can run again and ideally pass 1 out of 3 times. - We also sometimes get performance issues with older Python versions on the multiple contract init core tests. Let's keep this a more conservative number for now.
1 parent b350d43 commit b99cb18

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/core/contracts/test_contract_init.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def test_init_multiple_contracts_performance(w3, emitter_contract_data):
8585
abi=emitter_contract_data["abi"], bytecode=emitter_contract_data["bytecode"]
8686
)
8787
# assert initializing 500 contracts is within a conservative / reasonable time
88-
assert (time.time() - start_time) < 1.5
88+
assert (time.time() - start_time) < 1.75
8989

9090

9191
# -- async -- #
@@ -98,4 +98,4 @@ def test_async_init_multiple_contracts_performance(async_w3, emitter_contract_da
9898
abi=emitter_contract_data["abi"], bytecode=emitter_contract_data["bytecode"]
9999
)
100100
# assert initializing 500 contracts is within a conservative / reasonable time
101-
assert (time.time() - start_time) < 1.5
101+
assert (time.time() - start_time) < 1.75

web3/_utils/module_testing/eth_module.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2388,6 +2388,7 @@ async def test_async_eth_replace_transaction_gas_price_too_low(
23882388
with pytest.raises(Web3ValueError):
23892389
await async_w3.eth.replace_transaction(txn_hash, txn_params)
23902390

2391+
@flaky_geth_dev_mining
23912392
@pytest.mark.asyncio
23922393
async def test_async_eth_replace_transaction_gas_price_defaulting_minimum(
23932394
self, async_w3: "AsyncWeb3", async_keyfile_account_address: ChecksumAddress
@@ -2411,6 +2412,7 @@ async def test_async_eth_replace_transaction_gas_price_defaulting_minimum(
24112412
gas_price * 1.125
24122413
) # minimum gas price
24132414

2415+
@flaky_geth_dev_mining
24142416
@pytest.mark.asyncio
24152417
async def test_async_eth_replace_transaction_gas_price_defaulting_strategy_higher(
24162418
self, async_w3: "AsyncWeb3", async_keyfile_account_address: ChecksumAddress
@@ -2439,6 +2441,7 @@ def higher_gas_price_strategy(_async_w3: "AsyncWeb3", _txn: TxParams) -> Wei:
24392441
) # Strategy provides higher gas price
24402442
async_w3.eth.set_gas_price_strategy(None) # reset strategy
24412443

2444+
@flaky_geth_dev_mining
24422445
@pytest.mark.asyncio
24432446
async def test_async_eth_replace_transaction_gas_price_defaulting_strategy_lower(
24442447
self, async_w3: "AsyncWeb3", async_keyfile_account_address: ChecksumAddress

0 commit comments

Comments
 (0)