Skip to content

Commit

Permalink
Avoid blocking drop at end of restart tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jbearer committed Aug 15, 2024
1 parent 9f607ff commit 6c15478
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sequencer/src/restart_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ async fn test_restart_helper(network: (usize, usize), restart: (usize, usize), c
network.check_progress().await;
// Restart some combination of nodes and ensure progress resumes.
network.restart(restart.0, restart.1).await;

network.shut_down().await;
}

#[async_std::test]
Expand Down Expand Up @@ -594,6 +596,17 @@ impl TestNetwork {
self.check_progress().await;
}

async fn shut_down(mut self) {
tracing::info!("shutting down test network");
join_all(
self.da_nodes
.iter_mut()
.map(TestNode::stop)
.chain(self.regular_nodes.iter_mut().map(TestNode::stop)),
)
.await;
}

fn num_nodes(&self) -> usize {
self.da_nodes.len() + self.regular_nodes.len()
}
Expand Down

0 comments on commit 6c15478

Please sign in to comment.