Fix decorator order in light-client tests#4652
Conversation
|
Hello @jtraglia please could you help us review this? |
|
Hey @omegajudith & @bomanaps this does technically fix the issue (by hiding the warnings), but it's not the proper fix. This will break the reference test generation side of things. For example, this works without warnings: But this will now fail:
|
|
I believe the correct solution is to change the decorator order so that To be clear, this: @with_light_client
+@spec_state_test_with_matching_config
@with_config_overrides(
{
"BLOB_SCHEDULE": sample_blob_schedule(initial_epoch=1, interval=1),
},
emit=False,
)
-@spec_state_test_with_matching_config
@with_presets([MINIMAL], reason="too slow")
def test_light_client_data_collection(spec, state): This will eventually call consensus-specs/tests/core/pyspec/eth2spec/test/context.py Lines 322 to 328 in aae5237 This decorator will handle this situation here: consensus-specs/tests/core/pyspec/eth2spec/test/utils/utils.py Lines 61 to 73 in aae5237 Please review/update all instances of This issue was not as easy and I thought it would be. Sorry about that. |
|
@jtraglia the yields when not in generation mode are consumed here: https://github.com/ethereum/consensus-specs/blob/master/tests/core/pyspec/eth2spec/test/utils/utils.py#L68-L73 in |
|
In my opinion this is the solution: #4658 |
This cannot ever run a test, because the behavoiur of |
Sorry, this is just a typo on my part. Look at the screenshot. |
Sorry, didn't read the screenshot, this is a clarification because some times it caused me problems. Not a priority but it would be good if k works with test_ in the reftests |
There was a problem hiding this comment.
Let's also revert the changes to this file.
…eturnNotNoneWarning)
…ig above @with_config_overrides
52cc3b0 to
c85f370
Compare
jtraglia
left a comment
There was a problem hiding this comment.
LGTM, thank you @omegajudith & @bomanaps!
|
It seems that the blob schedule is missing in the generated config.yaml, so now tests fail when trying to run in an external runner (that consumes the generated vectors). |
|
Note: The blob schedule was there in beta.0, it seems something about the decorator order change broke this. |
Certain light client tests no longer worked because the config.yaml was incomplete: ethereum/consensus-specs#4652 Tests are being fixed with next spec release and can be turned on again once available.
I gave bad advice to a new contributor. We "fixed" one issue & broke something else. See this link for context: #4652 (comment) This PR simply reverts the changes from that PR. The fix in the following PR is the correct fix: #4658
Certain light client tests no longer worked because the config.yaml was incomplete: ethereum/consensus-specs#4652 Tests are being fixed with next spec release and can be turned on again once available. Co-authored-by: tersec <tersec@users.noreply.github.com>


Fixes #4618.
Reorders decorators so
@spec_state_test_with_matching_configappears above@with_config_overridesin Altair light-client tests.Files touched:
Rational:
Test plan:
make venv && source .venv/bin/activate
make test PYTEST_ARGS='-q -k "light_client and altair"'