diff --git a/crates/spt/tests/create_bind_rest_active_e2e.rs b/crates/spt/tests/create_bind_rest_active_e2e.rs index 0d0e508..4a6055f 100644 --- a/crates/spt/tests/create_bind_rest_active_e2e.rs +++ b/crates/spt/tests/create_bind_rest_active_e2e.rs @@ -23,7 +23,7 @@ //! `api` expects; no spawned session pids to reap. use std::path::PathBuf; -use std::process::{Command, Output}; +use std::process::Command; use std::time::Duration; mod common; @@ -47,15 +47,7 @@ fn start_inproc_daemon() { panic!("in-process seed daemon did not come up"); } -fn output_bounded(mut cmd: Command, deadline: Duration) -> Output { - let (tx, rx) = std::sync::mpsc::channel(); - std::thread::spawn(move || { - let _ = tx.send(cmd.output()); - }); - rx.recv_timeout(deadline) - .expect("captured spt call must complete") - .expect("run spt") -} + /// The HARNESS-HOSTED live perch an `api listen` leaves: online, a ready marker, /// `controllable` unset (no broker PTY). The owner pid is a never-allocated one — @@ -106,16 +98,14 @@ fn a_fresh_bind_after_a_real_stop_comes_up_active_without_a_wake() { seed_harness_hosted_online(id, "sid-life-1"); // ── THE STOP (real verb). Its terminal normalize IS what writes the residue. ── - let stop = output_bounded( - { - let mut cmd = Command::new(&spt_bin); - cmd.no_window() - .args(["endpoint", "stop", id]) - .env("SPT_HOME", home.path()); - cmd - }, - Duration::from_secs(60), - ); + let stop = common::output_bounded({ + let mut cmd = Command::new(&spt_bin); + cmd.no_window() + .args(["endpoint", "stop", id]) + .env("SPT_HOME", home.path()); + cmd + }, + Duration::from_secs(60),); assert!( stop.status.success(), "endpoint stop must succeed on an evidenced endpoint: stdout={} stderr={}", @@ -136,28 +126,26 @@ fn a_fresh_bind_after_a_real_stop_comes_up_active_without_a_wake() { // ── THE FRESH LIFE (real verb): a new session binds over the stopped one, which // is where `endpoint start` lands. No wake in between. ── - let bind = output_bounded( - { - let mut cmd = Command::new(&spt_bin); - cmd.no_window() - .args([ - "api", - "--adapter", - "dummyharness", - "--manifest", - &mp, - "bind", - id, - "--type", - "live_agent", - "--set-session-id", - "sid-life-2", - ]) - .env("SPT_HOME", home.path()); - cmd - }, - Duration::from_secs(60), - ); + let bind = common::output_bounded({ + let mut cmd = Command::new(&spt_bin); + cmd.no_window() + .args([ + "api", + "--adapter", + "dummyharness", + "--manifest", + &mp, + "bind", + id, + "--type", + "live_agent", + "--set-session-id", + "sid-life-2", + ]) + .env("SPT_HOME", home.path()); + cmd + }, + Duration::from_secs(60),); assert!( bind.status.success(), "the fresh bind must succeed: stdout={} stderr={}",