From 514cae9e89c7d8364269add5620234c793e7c90b Mon Sep 17 00:00:00 2001 From: andrussal Date: Tue, 17 Feb 2026 10:54:36 +0100 Subject: [PATCH] feat(local-deployer): add per-node readiness wait for manual clusters --- .../deployers/local/src/manual/mod.rs | 5 ++++ .../deployers/local/src/node_control/mod.rs | 30 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/testing-framework/deployers/local/src/manual/mod.rs b/testing-framework/deployers/local/src/manual/mod.rs index d34f284..74b2195 100644 --- a/testing-framework/deployers/local/src/manual/mod.rs +++ b/testing-framework/deployers/local/src/manual/mod.rs @@ -73,6 +73,11 @@ impl ManualCluster { pub async fn wait_network_ready(&self) -> Result<(), ReadinessError> { self.nodes.wait_network_ready().await } + + pub async fn wait_node_ready(&self, name: &str) -> Result<(), ManualClusterError> { + self.nodes.wait_node_ready(name).await?; + Ok(()) + } } impl Drop for ManualCluster { diff --git a/testing-framework/deployers/local/src/node_control/mod.rs b/testing-framework/deployers/local/src/node_control/mod.rs index 4aab046..dc31d5f 100644 --- a/testing-framework/deployers/local/src/node_control/mod.rs +++ b/testing-framework/deployers/local/src/node_control/mod.rs @@ -51,6 +51,11 @@ pub enum NodeManagerError { #[source] source: DynError, }, + #[error("failed readiness check: {source}")] + Readiness { + #[source] + source: ReadinessError, + }, } pub struct NodeManager { @@ -191,6 +196,31 @@ impl NodeManager { wait_for_http_ports(&ports, E::readiness_endpoint_path()).await } + pub async fn wait_node_ready(&self, name: &str) -> Result<(), NodeManagerError> { + let port = { + let state = self.lock_state(); + let index = + *state + .indices_by_name + .get(name) + .ok_or_else(|| NodeManagerError::NodeName { + name: name.to_string(), + })?; + + state + .nodes + .get(index) + .map(|node| node.endpoints().api.port()) + .ok_or_else(|| NodeManagerError::NodeName { + name: name.to_string(), + })? + }; + + wait_for_http_ports(&[port], E::readiness_endpoint_path()) + .await + .map_err(|source| NodeManagerError::Readiness { source }) + } + pub async fn start_node_with( &self, name: &str,