Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write range sync tests in external event-driven form #6618

Open
wants to merge 6 commits into
base: unstable
Choose a base branch
from

Conversation

dapplion
Copy link
Collaborator

@dapplion dapplion commented Nov 27, 2024

Issue Addressed

Re-write existing range sync tests into an event-driven format to accommodate the refactor introduced in

This format was introduced in

and does not make assumptions about internal functions, it treats sync as a black box inputting actual events used in production.

Note: I've removed the generics used in range sync since now we don't unit test directly

@dapplion dapplion added work-in-progress PR is a work-in-progress syncing labels Nov 27, 2024
@dapplion dapplion marked this pull request as ready for review November 27, 2024 13:53
@dapplion dapplion added ready-for-review The code is ready for review and removed work-in-progress PR is a work-in-progress labels Nov 27, 2024
@jimmygchen jimmygchen self-assigned this Dec 10, 2024
rig.remember_block(finalized_peer_block);

// Add an additional peer to the second chain to make range update it's status
rig.add_finalized_peer();
Copy link
Member

Choose a reason for hiding this comment

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

I don't really understand what this line does - do we need to assert for some condition after doing this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I respected the original test sequence as written in #2827, it covered a bug which this final line triggered a debug assertion

@jimmygchen
Copy link
Member

Nice! Looks clean and easy to read 👍

@jimmygchen jimmygchen added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Dec 12, 2024
@dapplion dapplion requested a review from jimmygchen December 14, 2024 13:53
@dapplion
Copy link
Collaborator Author

    sync::tests::range::state_update_while_purging
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 86 filtered out; finished in 7.58s

──── STDERR:             network sync::tests::range::state_update_while_purging
thread 'sync::tests::range::state_update_while_purging' panicked at /home/runner/work/lighthouse/lighthouse/beacon_node/beacon_chain/src/test_utils.rs:904:14:
called `Result::unwrap()` on an `Err` value: ExecutionLayerMissing

This test is failing in CI after switching to async, but can't reproduce locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
syncing waiting-on-author The reviewer has suggested changes and awaits thier implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants