Repository navigation
fix(tests): guard v1 UNI output-price xfail + poll Anvil startup - #1
TimeToBuildBob wants to merge 4 commits into
Conversation
v1 test_get_price_output: UNI exchange output-price functions (getEthToTokenOutputPrice / getTokenToEthOutputPrice) raise EvmError: InvalidJump under Anvil's strict revm. Input-price functions on the same exchange pass; DAI exchange is fine. Added pytest.xfail matching the existing pattern in make_trade / make_trade_output (lines 472-476, 525-529). test_v4_examples anvil fixture: replaced sleep(3) with a socket polling loop (up to 30s, checking every 0.5s) so Anvil readiness is detected regardless of public RPC fork latency or runner load. Ruff auto-fixes co-committed: UP035 (typing.Generator → collections.abc), UP004 (class X(object) → class X). Git-Session-Id: 584d
The CODECOV_TOKEN secret is not configured for this fork repo. Set fail_ci_if_error: false so tests can pass even without coverage upload. Git-Session-Id: 1c936159-41f7-5908-bb42-d2edfe93b754
|
CI was failing because Fixed in 4c8ad67: set |
Anvil fetches uncached v4 PoolManager storage from the public ethereum.publicnode.com fork; a connection reset failed test_estimate_price_impact while 109 other tests passed. Pass --timeout/--retries to Anvil, poll the v4 fixture for readiness instead of sleep(3), and rerun only RPC-flake errors via pytest-rerunfailures. Git-Session-Id: 7c8cac77-228e-5a5a-a581-b51cf272f6c3
|
v4 CI was still red on
failed to get storage for 0x000000000004444c5dc75cB358380D2e3dE08A90
MPP HTTP request to https://ethereum.publicnode.com/ failed: connection resetThe three smaller volumes of the same test passed; the 1000 ETH case needed uncached PoolManager slots and publicnode reset mid-fetch. Pushed
Fresh CI is running on this head. Next monitoring cycle can merge if v4 is green. |
publicnode cannot serve eth_getBalance by block hash, so Anvil genesis failed with "block not found: hash …" and the v4 fixture timed out. Use --fork-state-by-number, skip node-info probes, pin 32 blocks behind latest, and fail immediately if Anvil exits during startup. Git-Session-Id: 7c8cac77-228e-5a5a-a581-b51cf272f6c3
|
Closing as obsolete. Upstream decided on 2026-10-11 in uniswap-python#479 that v1 CI coverage will be removed in the next release because v1 is deprecated, so the v1 UNI output-price xfail half of this PR has no target anymore. The fork's The other half, polling Anvil's RPC port instead of |
Summary
Two CI failures on the
masterCheckSuite (ID 26139510394):v1 matrix —
test_get_price_outputwith UNI pairs: The UNI v1 exchange's output-price Vyper bytecode raisesEvmError: InvalidJumpunder Anvil's strict revm. Input-price functions on the same exchange pass; DAI exchange is fine. Addedpytest.xfailmatching the existing pattern already inmake_trade/make_trade_output(lines 472-476, 525-529). The skip for token-token pairs (no ETH) is retained.v4 matrix —
ConnectionRefusedErrorintest_v4_examples.py: Theanvilfixture usedsleep(3)before connecting on port 10997. When the public mainnet RPC fork is slow or the runner is under load, 3 seconds is insufficient. Replaced with a socket-polling readiness loop (up to 30s, checking every 0.5s), which also kills Anvil cleanly on timeout.Ruff UP035/UP004 auto-fixes co-committed (typed import modernization in the same files).
Scope
Test plan
test_get_price_outputwith ETH/UNI and UNI/ETH pairs should now be reported asxfailedinstead ofFAILEDtest_v4_examples.pyshould no longer hitConnectionRefusedErrorat fixture setupCo-Authored-By: Bob bob@superuserlabs.com