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

Add a zebrad acceptance test that does a full sync to tip #3493

Closed
teor2345 opened this issue Feb 8, 2022 · 1 comment · Fixed by #3543
Closed

Add a zebrad acceptance test that does a full sync to tip #3493

teor2345 opened this issue Feb 8, 2022 · 1 comment · Fixed by #3543
Assignees
Labels
A-rust Area: Updates to Rust code C-testing Category: These are tests

Comments

@teor2345
Copy link
Contributor

teor2345 commented Feb 8, 2022

Motivation

This is the Rust part of:

Suggested Design

Here's one way to do the Rust part of this change:

Partly done in #3495:

  1. Create a future that returns when the estimated height has been reached
  2. Add that future to zebrad start's main loop as a "continuing task", so Zebra exits when it finishes

New work:
3. Create a sync test case with a 6 hour timeout, which uses a "stop at estimated height" config

// Wait for tasks to finish
let exit_status = loop {
let mut exit_when_task_finishes = true;
let result = select! {
sync_result = &mut syncer_task_handle => sync_result

Originally posted by @teor2345 in #1592 (comment)

Follow-Up Tasks

Required:

  • check that we are at least 200* blocks above the highest checkpoint (detects stalls)

* I picked 200 because 100 non-finalized blocks are excluded from checkpoint generation, and it takes 2 hours to build and run the test. (If mainnet syncs get fast, or we're using testnet.) If we make it any higher, the first time we submit each checkpoint update PR the tests will be slow, because we'll wait to sync newly generated blocks.

Useful to increase coverage:

  • wait until the mempool has been active for a few minutes before exiting (increases coverage)

Optional:

Only if needed due to CI failures:

  • Adjust the timeout so that at least 99% of syncs succeed (makes failing tests fail faster)

Here is a refactor I don't think we need to do yet:

@teor2345 teor2345 added A-rust Area: Updates to Rust code C-testing Category: These are tests P-Medium ⚡ labels Feb 8, 2022
@ftm1000 ftm1000 added the S-needs-triage Status: A bug report needs triage label Feb 9, 2022
@teor2345
Copy link
Contributor Author

teor2345 commented Feb 9, 2022

I just realised that the estimate logging PR does some of this stuff already:

Turns out logging estimates in a helpful way is similar to using them to stop Zebra.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rust Area: Updates to Rust code C-testing Category: These are tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants