From 694dc3bc485e6dfb78c52e21f4e7aa58fc8bc1a3 Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Sun, 8 Nov 2026 14:42:22 -0800 Subject: [PATCH] test(storage): synchronize owner startup with daemon readiness --- .../multi_connection_test/fail_closed.rs | 5 ++--- .../multi_connection_test/harness.rs | 18 ++++++------------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/crates/tracedecay/tests/storage_suite/multi_connection_test/fail_closed.rs b/crates/tracedecay/tests/storage_suite/multi_connection_test/fail_closed.rs index cfe16b33c9c..e1fcc3f8cab 100644 --- a/crates/tracedecay/tests/storage_suite/multi_connection_test/fail_closed.rs +++ b/crates/tracedecay/tests/storage_suite/multi_connection_test/fail_closed.rs @@ -59,7 +59,7 @@ fn split_brain_is_rejected_and_unavailable_daemon_fails_closed_until_restart() { "rejected contender is still running after fail-closed rejection" ); - stop_child(&mut owner); + drop(owner); install_unavailable_socket_sentinel(&socket_path); let before = storage_snapshot(&profile_db_path); for (label, mut command) in [ @@ -142,7 +142,7 @@ fn split_brain_is_rejected_and_unavailable_daemon_fails_closed_until_restart() { &profile_db_path, ); - let mut restarted = spawn_daemon(&home_path, &socket_path); + let restarted = spawn_daemon(&home_path, &socket_path); assert_command_success( "restarted daemon status", &tool_status(&home_path, &project_path, &socket_path), @@ -161,5 +161,4 @@ fn split_brain_is_rejected_and_unavailable_daemon_fails_closed_until_restart() { authority_after["epoch"].as_u64() > authority_before["epoch"].as_u64(), "restart must advance daemon authority epoch" ); - stop_child(&mut restarted); } diff --git a/crates/tracedecay/tests/storage_suite/multi_connection_test/harness.rs b/crates/tracedecay/tests/storage_suite/multi_connection_test/harness.rs index 8fb0c7d7af5..3e05bc4da24 100644 --- a/crates/tracedecay/tests/storage_suite/multi_connection_test/harness.rs +++ b/crates/tracedecay/tests/storage_suite/multi_connection_test/harness.rs @@ -136,19 +136,13 @@ fn wait_for_socket(socket_path: &Path, child: &mut Child) { ); } -pub(super) fn spawn_daemon(home: &Path, socket_path: &Path) -> ChildGuard { - let mut child = ChildGuard::new( - common::tracedecay_command_with_home(home) - .args(["daemon", "run", "--socket"]) +pub(super) fn spawn_daemon(home: &Path, socket_path: &Path) -> common::DaemonProcess { + common::spawn_tracedecay_daemon_with(home, |command| { + command + .arg("--socket") .arg(socket_path) - .stdin(Stdio::null()) - .stdout(Stdio::null()) - .stderr(Stdio::null()) - .spawn() - .expect("spawn daemon"), - ); - wait_for_socket(socket_path, &mut child); - child + .env_remove("TRACEDECAY_TEST_ALLOW_INCOMPLETE_HOLDER_SCAN"); + }) } /// Where the spawned daemon's stderr was redirected, when the caller captured