Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down Expand Up @@ -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),
Expand All @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading