diff --git a/crates/spt/tests/now_signal_delta_e2e.rs b/crates/spt/tests/now_signal_delta_e2e.rs index 87b22111..6972fd7b 100644 --- a/crates/spt/tests/now_signal_delta_e2e.rs +++ b/crates/spt/tests/now_signal_delta_e2e.rs @@ -44,6 +44,22 @@ use common::CommandNoWindowExt; use spt_store::perch::{self, ParentHint}; +fn start_real_daemon(spt_bin: &Path, home: &Path) { + let mut cmd = Command::new(spt_bin); + cmd.no_window() + .args(["daemon", "start"]) + .env("SPT_HOME", home) + .env_remove("SPT_AGENT_ID") + .env_remove("SPT_ENDPOINT_ID") + .env_remove("OWL_SESSION_ID"); + let out = common::output_bounded(cmd, Duration::from_secs(90)); + assert!( + out.status.success(), + "explicit daemon start failed: {}", + String::from_utf8_lossy(&out.stderr) + ); +} + fn manifest_with_io(home: &Path) -> PathBuf { let p = home.join("compliant.toml"); std::fs::write( @@ -59,9 +75,16 @@ fn manifest_with_io(home: &Path) -> PathBuf { fn the_first_poll_renders_a_no_perch_dispatch_and_the_second_poll_says_nothing() { let home = tempfile::tempdir().unwrap(); std::env::set_var("SPT_HOME", home.path()); + std::env::remove_var("SPT_AGENT_ID"); + std::env::remove_var("SPT_ENDPOINT_ID"); + std::env::remove_var("OWL_SESSION_ID"); spt_store::nodeid::load_or_create().expect("node identity"); - let spt_bin = PathBuf::from(env!("CARGO_BIN_EXE_spt")); + // This test exercises dispatch/result deltas, not daemon autostart. Start its + // real daemon before the synthetic perch points at this process: otherwise + // the spawned CLI is classified as hosted by `alice`, making cold autostart + // and panic cleanup depend on the CI runner's service-token context. + start_real_daemon(&spt_bin, home.path()); let author = "alice"; let sid = "now-signal-delta-sid";