Skip to content

Commit

Permalink
Check for early exits in the end of support task test (#6715)
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 authored May 18, 2023
1 parent 0c1abad commit fadddae
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions zebrad/tests/end_of_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
use std::time::Duration;

use color_eyre::eyre::Result;
use tokio::time::timeout;

use zebra_chain::{block::Height, chain_tip::mock::MockChainTip, parameters::Network};

use zebra_consensus::CheckpointList;

use zebrad::components::sync::end_of_support::{self, EOS_PANIC_AFTER, ESTIMATED_RELEASE_HEIGHT};

// Estimated blocks per day with the current 75 seconds block spacing.
Expand Down Expand Up @@ -80,7 +77,11 @@ async fn end_of_support_task() -> Result<()> {

let eos_future = end_of_support::start(Network::Mainnet, latest_chain_tip);

let _ = timeout(Duration::from_secs(15), eos_future).await.ok();
tokio::time::timeout(Duration::from_secs(15), eos_future)
.await
.expect_err(
"end of support task unexpectedly exited: it should keep running until Zebra exits",
);

assert!(logs_contain(
"Checking if Zebra release is inside support range ..."
Expand Down

0 comments on commit fadddae

Please sign in to comment.