Skip to content

fix(tests): optimize json_infra fixture reads#1730

Closed
gurukamath wants to merge 2 commits into
ethereum:forks/osakafrom
gurukamath:optimise-json-infra
Closed

fix(tests): optimize json_infra fixture reads#1730
gurukamath wants to merge 2 commits into
ethereum:forks/osakafrom
gurukamath:optimise-json-infra

Conversation

@gurukamath

@gurukamath gurukamath commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

What was wrong?

Running the json_infra does a lot of I?O that can potentially be avoided.

Related to Issue #

How was it fixed?

Optimise file reads from disk using some caching techniques and queueing the test fixtures in a better order.

gurukamath pushed a commit to gurukamath/execution-specs that referenced this pull request Nov 3, 2025
* feat(tests): block rlp size limit eip-7934 test cases.

Co-authored-by: Mario Vega <marioevz@gmail.com>
Co-authored-by: felipe <fselmo2@gmail.com>

* fix: minor rename

* Update tests/osaka/eip7934_block_rlp_limit/test_max_block_rlp_size.py

Co-authored-by: felipe <fselmo2@gmail.com>

* fix(tests): remove misleading block rlp cases

---------

Co-authored-by: Mario Vega <marioevz@gmail.com>
Co-authored-by: felipe <fselmo2@gmail.com>
@codecov-commenter

codecov-commenter commented Nov 3, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.07%. Comparing base (9563a51) to head (6115b7b).
⚠️ Report is 37 commits behind head on forks/osaka.

Additional details and impacted files
@@             Coverage Diff              @@
##           forks/osaka    #1730   +/-   ##
============================================
  Coverage        86.07%   86.07%           
============================================
  Files              743      743           
  Lines            44078    44078           
  Branches          3894     3894           
============================================
  Hits             37938    37938           
  Misses            5659     5659           
  Partials           481      481           
Flag Coverage Δ
unittests 86.07% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@SamWilsn SamWilsn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marioevz used --dist=loadfile in #1666, would that make sense here?

@gurukamath

Copy link
Copy Markdown
Contributor Author

@marioevz used --dist=loadfile in #1666, would that make sense here?

I have implemented --dist=loadgroup by defining all the tests in a particular json fixture file as part of the same xdist group. That allows each file to be read exactly once and makes the LRU caching technique maximally useful. Just waiting to see what the CI runtime from this is

@gurukamath

Copy link
Copy Markdown
Contributor Author

@marioevz used --dist=loadfile in #1666, would that make sense here?

Next, I will try out some of the ideas from that PR and see what works best

@SamWilsn

SamWilsn commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

I have implemented --dist=loadgroup by defining all the tests in a particular json fixture file as part of the same xdist group.

I saw! Was wondering if loadfile would save you having to manually create those groups.

@gurukamath

gurukamath commented Nov 4, 2025

Copy link
Copy Markdown
Contributor Author

I saw! Was wondering if loadfile would save you having to manually create those groups.

Ah. I see. From what I understand --dist=loadfile groups the tests by the python test file (.py file) and has no way of distinguishing the different json fixtures (unless we explicitly tell it). This is why I decided to explicitly define the groups and run the --dist=loadgroup which should achieve the intended effect.

@gurukamath

Copy link
Copy Markdown
Contributor Author

Closing this in favor of #1666

@gurukamath gurukamath closed this Nov 22, 2025
SamWilsn pushed a commit that referenced this pull request Dec 9, 2025
* feat(tests): block rlp size limit eip-7934 test cases.

Co-authored-by: Mario Vega <marioevz@gmail.com>
Co-authored-by: felipe <fselmo2@gmail.com>

* fix: minor rename

* Update tests/osaka/eip7934_block_rlp_limit/test_max_block_rlp_size.py

Co-authored-by: felipe <fselmo2@gmail.com>

* fix(tests): remove misleading block rlp cases

---------

Co-authored-by: Mario Vega <marioevz@gmail.com>
Co-authored-by: felipe <fselmo2@gmail.com>
SamWilsn pushed a commit that referenced this pull request Dec 9, 2025
* feat(tests): block rlp size limit eip-7934 test cases.

Co-authored-by: Mario Vega <marioevz@gmail.com>
Co-authored-by: felipe <fselmo2@gmail.com>

* fix: minor rename

* Update tests/osaka/eip7934_block_rlp_limit/test_max_block_rlp_size.py

Co-authored-by: felipe <fselmo2@gmail.com>

* fix(tests): remove misleading block rlp cases

---------

Co-authored-by: Mario Vega <marioevz@gmail.com>
Co-authored-by: felipe <fselmo2@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants