Skip to content

Commit

Permalink
add and use restart_stop_at_height_for_network() in acceptance test (
Browse files Browse the repository at this point in the history
  • Loading branch information
oxarbitrage authored and dconnolly committed Jun 16, 2021
1 parent 81ceac9 commit 2ef1525
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions zebrad/tests/acceptance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,9 +724,18 @@ fn sync_one_checkpoint_testnet() -> Result<()> {
/// Test if `zebrad` can sync the first checkpoint, restart, and stop on load.
#[test]
fn restart_stop_at_height() -> Result<()> {
zebra_test::init();

restart_stop_at_height_for_network(Network::Mainnet, Height(0))?;
restart_stop_at_height_for_network(Network::Testnet, Height(0))?;

Ok(())
}

fn restart_stop_at_height_for_network(network: Network, height: Height) -> Result<()> {
let reuse_tempdir = sync_until(
Height(0),
Mainnet,
height,
network,
STOP_AT_HEIGHT_REGEX,
SMALL_CHECKPOINT_TIMEOUT,
None,
Expand All @@ -735,8 +744,8 @@ fn restart_stop_at_height() -> Result<()> {
// if stopping does not write the rocksdb database to disk, Zebra will
// sync, rather than stopping immediately at the configured height
sync_until(
Height(0),
Mainnet,
height,
network,
"state is already at the configured height",
STOP_ON_LOAD_TIMEOUT,
Some(reuse_tempdir),
Expand Down

0 comments on commit 2ef1525

Please sign in to comment.