这是indexloc提供的服务,不要输入任何密码
Skip to content

bug(types): Intermitent failure during src/ethereum_test_types/tests/test_blob_types.py #1942

@marioevz

Description

@marioevz

Getting an intermittent failure in one of the unit tests for the blob types:

=============================================================== short test summary info ================================================================
FAILED src/ethereum_test_types/tests/test_blob_types.py::test_blob_proof_corruption[Prague-ProofCorruptionMode.CORRUPT_ALL_BYTES] - AssertionError: Tried to load blob from file but /home/marioevz/.cache/ethereum-execution-spec-tests/cached_blobs/blob_0_cell_proofs_0.json does not exist
==================================== 1 failed, 997 passed, 2 skipped, 6 xfailed, 1 xpassed, 806 warnings in 21.40s =====================================

Full trace:

_______________________________________ test_blob_proof_corruption[Prague-ProofCorruptionMode.CORRUPT_ALL_BYTES] _______________________________________
[gw14] linux -- Python 3.13.2 /home/marioevz/Development/Eth/execution-spec-tests/.tox/pytest/bin/python3

corruption_mode = <ProofCorruptionMode.CORRUPT_ALL_BYTES: 4>, fork = Prague

    @pytest.mark.parametrize(
        "corruption_mode",
        [
            Blob.ProofCorruptionMode.CORRUPT_ALL_BYTES,
            Blob.ProofCorruptionMode.CORRUPT_FIRST_BYTE,
            Blob.ProofCorruptionMode.CORRUPT_LAST_BYTE,
            Blob.ProofCorruptionMode.CORRUPT_TO_ALL_ZEROES,
        ],
    )
    @pytest.mark.parametrize("fork", [Cancun, Prague, Osaka])
    def test_blob_proof_corruption(
        corruption_mode,
        fork,
    ):
        """
        Generates blobs for different forks, corrupts their proofs and ensures that
        the corrupted proof is not equal to the correct proof.
        """
        timestamp = 100
>       b = Blob.from_fork(fork=fork, timestamp=timestamp)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/ethereum_test_types/tests/test_blob_types.py:65:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/ethereum_test_types/blob_types.py:193: in from_fork
    return Blob.from_file(Blob.get_filename(fork, seed))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

file_name = 'blob_0_cell_proofs_0.json'

    @staticmethod
    def from_file(file_name: str) -> "Blob":
        """
        Read a .json file and reconstruct object it represents.

        You can load a blob only via its filename (with or without .json extension).
        """
        # ensure filename was passed
        assert file_name.startswith("blob_"), (
            f"You provided an invalid blob filename. Expected it to start with 'blob_' "
            f"but got: {file_name}"
        )

        if ".json" not in file_name:
            file_name = file_name + ".json"

        # determine path where this blob would be stored if it existed
        blob_file_location = CACHED_BLOBS_DIRECTORY / file_name

        # use lock to avoid race conditions
        lock_file_path = blob_file_location.with_suffix(".lock")
        with FileLock(lock_file_path):
            # check whether blob exists
>           assert blob_file_location.exists(), (
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                f"Tried to load blob from file but {blob_file_location} does not exist"
            )
E           AssertionError: Tried to load blob from file but /home/marioevz/.cache/ethereum-execution-spec-tests/cached_blobs/blob_0_cell_proofs_0.json does not exist

src/ethereum_test_types/blob_types.py:244: AssertionError
=================================================================== warnings summary ===================================================================

Running the test again fixes the issue but it would be nice to figure out why is this happening.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions