From 2ff57533b112f36e1486cae801f1dc6b82cdf564 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 19 Oct 2026 17:53:58 +0200 Subject: [PATCH] Cut c2b fix: a test world runs a host-actuator target's workload through its own port --- src/control_plane.rs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/control_plane.rs b/src/control_plane.rs index 8e43d81..e7a8009 100644 --- a/src/control_plane.rs +++ b/src/control_plane.rs @@ -5039,6 +5039,10 @@ struct Engine { docker_runner: DockerRunnerDriver, systemd_workload: Arc, host_actuators: Option, + /// A test world that serves no host actuator runs a host-actuator + /// binding's workload through this port instead. + #[cfg(test)] + host_workload: Mutex>>, history_report: ReportOnce, /// One `ReportOnce` per faulting record, so one wedged transaction says /// its fault once and never drowns another's. @@ -5140,6 +5144,8 @@ impl Engine { docker_runner: DockerRunnerDriver::default(), systemd_workload, host_actuators, + #[cfg(test)] + host_workload: Mutex::default(), history_report: ReportOnce::default(), fault_reports: Mutex::default(), resume_backoff: Mutex::default(), @@ -5375,9 +5381,15 @@ impl Engine { let (_, binding) = plan.parsed_inputs()?; Ok(match &binding.workload { WorkloadBinding::SystemdTransient(_) => Arc::clone(&self.systemd_workload), - WorkloadBinding::HostActuator(_) => Arc::new(HostActuatorWorkloadDriver { - access: self.host_access()?, - }), + WorkloadBinding::HostActuator(_) => { + #[cfg(test)] + if let Some(port) = self.host_workload.lock().expect("host workload mutex").clone() { + return Ok(port); + } + Arc::new(HostActuatorWorkloadDriver { + access: self.host_access()?, + }) + } }) } @@ -15892,7 +15904,8 @@ mod tests { }); let world = EngineFixture::with_workload(workload.clone())?; *workload.store.lock().unwrap() = Some(world.state_store.clone()); - let live = transaction_at(&world, DeploymentPhase::Warming)?; + let incumbent = admit_incumbent(&world)?; + let live = seeded_transaction(&world, DeploymentPhase::Warming, CommandKind::Continuity, Some(&incumbent))?; let id = live.transaction_id.as_str(); // The Warming step waits for Odin; waiting again rewrites nothing, so // the step succeeds without touching the record it will find missing.