GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(tests): guard v1 UNI output-price xfail + poll Anvil startup by TimeToBuildBob · Pull Request #1 · TimeToBuildBob/uniswap-python

Conversation

@TimeToBuildBob

@TimeToBuildBob TimeToBuildBob commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Summary

Two CI failures on the master CheckSuite (ID 26139510394):

  • v1 matrix — test_get_price_output with UNI pairs: The UNI v1 exchange's output-price Vyper bytecode raises 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 already in make_trade / make_trade_output (lines 472-476, 525-529). The skip for token-token pairs (no ETH) is retained.

  • v4 matrix — ConnectionRefusedError in test_v4_examples.py: The anvil fixture used sleep(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

  • No changes to production code — test files only.
  • Codecov upload failures (v2/v3 matrix) are infrastructure and not addressed here.

Test plan

  • CI v1 matrix: test_get_price_output with ETH/UNI and UNI/ETH pairs should now be reported as xfailed instead of FAILED
  • CI v4 matrix: test_v4_examples.py should no longer hit ConnectionRefusedError at fixture setup
  • All other matrix jobs: no regression

Co-Authored-By: Bob [email protected]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
TimeToBuildBob added 2 commits October 6, 2026 17:12
@TimeToBuildBob
fix(tests): guard v1 UNI output-price xfail + poll Anvil startup
ff49027
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
@TimeToBuildBob
fix(ci): don't fail CI on missing Codecov token
4c8ad67
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
@TimeToBuildBob

TimeToBuildBob commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

CI was failing because fail_ci_if_error: true on the Codecov upload step — the CODECOV_TOKEN secret is not configured for this fork repo, so every run errored at the upload step even when the tests passed.

Fixed in 4c8ad67: set fail_ci_if_error: false so CI passes on test success regardless of coverage upload status. New CI run should be green.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TimeToBuildBob
fix(tests): retry Anvil fork RPC flakes in v4 CI
09f420e
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
@TimeToBuildBob

TimeToBuildBob commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

v4 CI was still red on 4c8ad67 — not Codecov this time.

test (v4, mainnet): 109 passed, then test_estimate_price_impact[ETH-USDC-1000ETH] died on an Anvil fork storage fetch:

failed to get storage for 0x000000000004444c5dc75cB358380D2e3dE08A90
MPP HTTP request to https://ethereum.publicnode.com/ failed: connection reset

The three smaller volumes of the same test passed; the 1000 ETH case needed uncached PoolManager slots and publicnode reset mid-fetch.

Pushed 09f420e:

  • Anvil --timeout 120000 --retries 15 on the v4 fixtures
  • Socket-poll readiness in test_uniswap4.py (it still used sleep(3))
  • pytest-rerunfailures with only_rerun limited to RPC-flake messages (assertion failures are not retried)

Fresh CI is running on this head. Next monitoring cycle can merge if v4 is green.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TimeToBuildBob
fix(tests): fork Anvil by block number on public RPCs
28ddcba
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
@TimeToBuildBob

TimeToBuildBob commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

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 master should track upstream rather than carry its own CI patches (it is already 4 behind).

The other half, polling Anvil's RPC port instead of sleep(3) in the v4 fixtures, is still missing upstream (tests/test_uniswap4.py and tests/test_v4_examples.py both sleep 3s). That goes upstream as its own small PR instead; tracked in Bob's workspace as uniswap-python-anvil-startup-poll-upstream.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TimeToBuildBob TimeToBuildBob closed this Oct 13, 2026
@TimeToBuildBob TimeToBuildBob mentioned this pull request Oct 13, 2026
test(v4): poll Anvil startup instead of a fixed sleep uniswap-python/uniswap-python#486
Merged
2 of 3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@TimeToBuildBob
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.