Skip to content

Commit c9bdd79

Browse files
committed
Remove json fixture cache
It was causing test failures after a VMTest move, and didn't seem to be providing a measurable benefit (perhaps even a slowdown). The test failure showed up as trying to load the files in the old VMTest location in ethereum/tests. Those file paths were being loaded out of a stale cache.
1 parent 535c82c commit c9bdd79

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

eth/tools/fixtures/generation.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import hashlib
2-
import os
32

43
from typing import (
54
Any,
@@ -14,7 +13,6 @@
1413

1514
from .loading import (
1615
find_fixtures,
17-
find_fixture_files,
1816
)
1917

2018

@@ -59,31 +57,8 @@ def generate_fixture_tests(metafunc: Any,
5957
fixtures (such as expanding the statetest fixtures to be multiple tests for
6058
each fork.
6159
"""
62-
fixture_namespace = os.path.basename(base_fixture_path)
63-
6460
if 'fixture_data' in metafunc.fixturenames:
65-
all_fixture_paths = find_fixture_files(base_fixture_path)
66-
current_file_hash = get_fixtures_file_hash(all_fixture_paths)
67-
68-
data_cache_key = f'pyevm/statetest/fixtures/{fixture_namespace}/data'
69-
file_hash_cache_key = f'pyevm/statetest/fixtures/{fixture_namespace}/data-hash'
70-
71-
cached_file_hash = metafunc.config.cache.get(file_hash_cache_key, None)
72-
cached_fixture_data = metafunc.config.cache.get(data_cache_key, None)
73-
74-
bust_cache = any((
75-
cached_file_hash is None,
76-
cached_fixture_data is None,
77-
cached_file_hash != current_file_hash,
78-
))
79-
80-
if bust_cache:
81-
all_fixtures = find_fixtures(base_fixture_path)
82-
83-
metafunc.config.cache.set(data_cache_key, all_fixtures)
84-
metafunc.config.cache.set(file_hash_cache_key, current_file_hash)
85-
else:
86-
all_fixtures = cached_fixture_data
61+
all_fixtures = find_fixtures(base_fixture_path)
8762

8863
if not all_fixtures:
8964
raise AssertionError(

eth/tools/fixtures/loading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def filter_fixtures(all_fixtures: Iterable[Any],
101101
if mark:
102102
yield pytest.param(
103103
(fixture_path, *fixture_data[1:]),
104-
marks=mark,
104+
marks=mark, # type: ignore # we don't annotate the test code that calls this
105105
)
106106
continue
107107

0 commit comments

Comments
 (0)