From cedfa28775a0b67bf38faffa46d75817640517f4 Mon Sep 17 00:00:00 2001 From: danceratopz Date: Thu, 18 Jun 2026 13:05:07 +0200 Subject: [PATCH 1/6] chore(ci): run json-loader on Python 3.14 for faster coverage Coverage was enabled for the `json-loader` job in #2975, but it still runs on the default Python 3.13, so `coverage` uses the slower C tracer. Pin the job to 3.14 like `fill`, where coverage.py auto-selects `sys.monitoring`. --- .github/workflows/test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index df94030cac..29d4d393ae 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -140,6 +140,8 @@ jobs: with: submodules: recursive - uses: ./.github/actions/setup-uv + with: + python-version: "3.14" - uses: ./.github/actions/setup-env - name: Fill and run json-loader tests run: just json-loader From 4737dfcfabb65a0938f9b0bbb693c3a2b0b07f9a Mon Sep 17 00:00:00 2001 From: danceratopz Date: Thu, 18 Jun 2026 13:05:07 +0200 Subject: [PATCH 2/6] chore(tooling): match json-loader phase-2 worker count to fill The fixture-consuming `pytest` phase was pinned to `-n auto --maxprocesses 6`, capping it at 6 workers, while the fill phase uses `-n {{ xdist_workers }}` (`auto` in CI) and scales with the runner. The cap carried over from the `tox` config in #2555. Use the same worker setting so phase 2 is not throttled below the available cores. --- Justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Justfile b/Justfile index 6da3a1eabc..ad51066349 100644 --- a/Justfile +++ b/Justfile @@ -168,7 +168,7 @@ json-loader *args: --cov-fail-under=85 uv run pytest \ -m "not slow" \ - -n auto --maxprocesses 6 --dist=loadfile \ + -n {{ xdist_workers }} --dist=loadfile \ --cov-config=pyproject.toml \ --cov=ethereum \ --cov-branch \ From a77faa21f00ffd9fc59e0c438a29f4b8bd34bd34 Mon Sep 17 00:00:00 2001 From: danceratopz Date: Thu, 18 Jun 2026 13:51:09 +0200 Subject: [PATCH 3/6] chore(tooling): report 50 slowest durations in json-loader Add `--durations=50` to both phases of the `json-loader` recipe (the `fill` step and the `pytest` step) so CI surfaces the slowest fills and fixture executions. The standalone `fill` recipe already reports these; this brings `json-loader` to parity and gives data to guide further trimming of the `eels_base_coverage` set. --- Justfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Justfile b/Justfile index ad51066349..3b25cc77a5 100644 --- a/Justfile +++ b/Justfile @@ -165,6 +165,7 @@ json-loader *args: --cov=ethereum \ --cov-branch \ --cov-report=term \ + --durations=50 \ --cov-fail-under=85 uv run pytest \ -m "not slow" \ @@ -174,6 +175,7 @@ json-loader *args: --cov-branch \ --cov-report=term \ --cov-report "xml:{{ output_dir }}/json-loader/coverage.xml" \ + --durations=50 \ --basetemp="{{ output_dir }}/json-loader/tmp" \ "$@" \ tests/json_loader From 7ed8a0e5aa15a636e038530fd57d04075ae6091f Mon Sep 17 00:00:00 2001 From: danceratopz Date: Thu, 18 Jun 2026 14:46:19 +0200 Subject: [PATCH 4/6] chore(tests,tooling): spread json-loader phase 2 across xdist workers `--dist=loadfile` pinned every test in a file to one worker, so the two `test_tools_new_fork.py::test_end_to_end` cases (~256s and ~203s) ran back-to-back on a single worker while the rest sat idle. Switch phase 2 to `--dist=loadgroup` and tag each fixtures file's cases with an `xdist_group` keyed by the file. Fixture cases keep file-locality (the `data` JSON cache parses once per file), while the ungrouped tooling tests distribute individually onto separate workers. --- Justfile | 2 +- tests/json_loader/conftest.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Justfile b/Justfile index 3b25cc77a5..4713173f9a 100644 --- a/Justfile +++ b/Justfile @@ -169,7 +169,7 @@ json-loader *args: --cov-fail-under=85 uv run pytest \ -m "not slow" \ - -n {{ xdist_workers }} --dist=loadfile \ + -n {{ xdist_workers }} --dist=loadgroup \ --cov-config=pyproject.toml \ --cov=ethereum \ --cov-branch \ diff --git a/tests/json_loader/conftest.py b/tests/json_loader/conftest.py index e5faa6b153..298edad02d 100644 --- a/tests/json_loader/conftest.py +++ b/tests/json_loader/conftest.py @@ -5,7 +5,7 @@ from _pytest.config.argparsing import Parser from _pytest.nodes import Item -from pytest import Collector, Config, Session, fixture +from pytest import Collector, Config, Session, fixture, mark from ethereum_spec_tools.evm_tools.t8n import ForkCache @@ -181,7 +181,15 @@ def pytest_configure(config: Config) -> None: def pytest_collection_modifyitems(config: Config, items: list[Item]) -> None: - """Filter test items.""" + """Assign xdist groups and filter test items.""" + # Group each fixtures file's cases onto one xdist worker (under + # `--dist=loadgroup`) so the file's JSON is parsed once. Tests without a + # group (e.g. the slow new-fork CLI tests) then distribute individually + # instead of being pinned to one worker as `--dist=loadfile` forced. + for item in items: + if isinstance(item, FixtureTestItem): + item.add_marker(mark.xdist_group(item.fixtures_file.nodeid)) + tests_path = config.getoption("tests_path", None) if tests_path is None: return From 964d3b1d4b4ac45aea3dd83fd0e4159a7b8afc66 Mon Sep 17 00:00:00 2001 From: danceratopz Date: Thu, 18 Jun 2026 15:47:17 +0200 Subject: [PATCH 5/6] fix(tests): apply json-loader xdist_group before xdist reads it The previous commit added the `xdist_group` in a default-ordered `pytest_collection_modifyitems`, but xdist reads each item's group before that hook runs, so the marker was ignored and phase 2 still ran as plain `load` (fixtures scattered, re-parsing their JSON per case). Mark the hook `tryfirst=True` so the group is assigned first: fixture cases regroup by file (parsed once) and the slow tooling tests still spread across workers. --- tests/json_loader/conftest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/json_loader/conftest.py b/tests/json_loader/conftest.py index 298edad02d..bc49480401 100644 --- a/tests/json_loader/conftest.py +++ b/tests/json_loader/conftest.py @@ -5,7 +5,7 @@ from _pytest.config.argparsing import Parser from _pytest.nodes import Item -from pytest import Collector, Config, Session, fixture, mark +from pytest import Collector, Config, Session, fixture, hookimpl, mark from ethereum_spec_tools.evm_tools.t8n import ForkCache @@ -180,12 +180,16 @@ def pytest_configure(config: Config) -> None: config.stash[desired_forks_key] = desired_forks +@hookimpl(tryfirst=True) def pytest_collection_modifyitems(config: Config, items: list[Item]) -> None: """Assign xdist groups and filter test items.""" # Group each fixtures file's cases onto one xdist worker (under # `--dist=loadgroup`) so the file's JSON is parsed once. Tests without a # group (e.g. the slow new-fork CLI tests) then distribute individually # instead of being pinned to one worker as `--dist=loadfile` forced. + # + # `tryfirst=True` is required: xdist reads each item's group before a + # default-ordered hook runs, so the marker must be added first. for item in items: if isinstance(item, FixtureTestItem): item.add_marker(mark.xdist_group(item.fixtures_file.nodeid)) From 854a6e9bb36ecc100327f3c2c899a30cd6f46df5 Mon Sep 17 00:00:00 2001 From: danceratopz Date: Thu, 18 Jun 2026 16:49:34 +0200 Subject: [PATCH 6/6] chore(tests,tooling): revert json-loader phase-2 xdist regrouping Reverts the `loadgroup` rebalance and its `tryfirst` follow-up. In CI the regrouping did not reliably split the two slow `new_fork` CLI tests: phase 2 stayed ~420-470s either way (monsters serialized under one layout, fixtures imbalanced by file-grouping under the other), within runner variance. Phase 2 returns to `--dist=loadfile`. The slow tooling tests are better moved out of json-loader entirely, tracked as a follow-up. --- Justfile | 2 +- tests/json_loader/conftest.py | 16 ++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/Justfile b/Justfile index 4713173f9a..3b25cc77a5 100644 --- a/Justfile +++ b/Justfile @@ -169,7 +169,7 @@ json-loader *args: --cov-fail-under=85 uv run pytest \ -m "not slow" \ - -n {{ xdist_workers }} --dist=loadgroup \ + -n {{ xdist_workers }} --dist=loadfile \ --cov-config=pyproject.toml \ --cov=ethereum \ --cov-branch \ diff --git a/tests/json_loader/conftest.py b/tests/json_loader/conftest.py index bc49480401..e5faa6b153 100644 --- a/tests/json_loader/conftest.py +++ b/tests/json_loader/conftest.py @@ -5,7 +5,7 @@ from _pytest.config.argparsing import Parser from _pytest.nodes import Item -from pytest import Collector, Config, Session, fixture, hookimpl, mark +from pytest import Collector, Config, Session, fixture from ethereum_spec_tools.evm_tools.t8n import ForkCache @@ -180,20 +180,8 @@ def pytest_configure(config: Config) -> None: config.stash[desired_forks_key] = desired_forks -@hookimpl(tryfirst=True) def pytest_collection_modifyitems(config: Config, items: list[Item]) -> None: - """Assign xdist groups and filter test items.""" - # Group each fixtures file's cases onto one xdist worker (under - # `--dist=loadgroup`) so the file's JSON is parsed once. Tests without a - # group (e.g. the slow new-fork CLI tests) then distribute individually - # instead of being pinned to one worker as `--dist=loadfile` forced. - # - # `tryfirst=True` is required: xdist reads each item's group before a - # default-ordered hook runs, so the marker must be added first. - for item in items: - if isinstance(item, FixtureTestItem): - item.add_marker(mark.xdist_group(item.fixtures_file.nodeid)) - + """Filter test items.""" tests_path = config.getoption("tests_path", None) if tests_path is None: return