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 restart acceptance tests #1666

Closed
3 tasks
oxarbitrage opened this issue Feb 2, 2021 · 2 comments
Closed
3 tasks

Add restart acceptance tests #1666

oxarbitrage opened this issue Feb 2, 2021 · 2 comments
Labels
C-enhancement Category: This is an improvement

Comments

@oxarbitrage
Copy link
Contributor

In #1637 we fixed specific panics happening when the users tries to shutdown zebra with ctrl-c.

We should make a test for this:

  • add a small unit test that checks that IS_SHUTTING_DOWN is false:
    at the start of the test, and
    after you've spawned a shutdown() task using spawn_blocking

We don't need to check that IS_SHUTTING_DOWN becomes true - we'll notice the panics if that part of the code ever breaks.

Additionally we want to add tests where zebrad is killed and restarted after some time making sure the database is not corrupted in particular in the middle of checkpoints:

Add an acceptance test that makes sure we can restart in the middle of a checkpoint:

  • Add an acceptance test that waits for 10 (?) seconds, kills zebrad, and then restarts it (rather than using debug_stop_at_height)

Restarting in the middle of a checkpoint:

  • Add a height parameter to the restart_stop_at_height test
    Run the test for heights 0, zebra_consensus::MAX_CHECKPOINT_HEIGHT_GAP / 2, and zebra_consensus::MAX_CHECKPOINT_HEIGHT_GAP

That way, we'll test that Zebra can restart:

  • after genesis
  • after an incomplete checkpoint
  • after a full checkpoint
  • after being killed (rather than exiting normally)
@teor2345
Copy link
Contributor

The zebra-test/scripts/shutdown-errors shell script does these tests, but it doesn't run in CI yet.

https://github.com/oxarbitrage/zebra/pull/164/files#diff-ff4bc0a5d763d194708c5b5a28ed4cc2650323337823eb004aae0c2ef77665ab

@oxarbitrage
Copy link
Contributor Author

We made serveral changes to the shutdown and we are pretty much ok with it, at least by now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: This is an improvement
Projects
None yet
Development

No branches or pull requests

3 participants