Trim comments and docs to what the code needs

AI Assisted
This commit is contained in:
Seth committed 2026-12-05 13:19:59 -08:00
1 parent eba3c3bf0c
commit 0bd721fc27
33 files changed
+292 -392

No files matched your search

@@ -654,8 +654,7 @@ fn stray_gone(stray: u32) -> bool {
}
/// An agent that ends by itself leaves its process group alone: work the
/// person asked it to leave running (a dev server it backgrounded) stays up,
/// as it did before the app ended process groups at all.
/// person asked it to leave running (a dev server it backgrounded) stays up.
#[cfg(unix)]
#[test]
fn an_agent_that_exits_by_itself_leaves_its_process_group_running() {
@@ -698,8 +697,8 @@ fn a_replaced_agent_takes_its_process_group_with_it() {
h.manager.stop();
}
/// Quitting right after New Session: the replaced agent's grace is still
/// running on a thread that would end with the app.
/// A stop right after a replace waits for the old agent's process group: its
/// grace runs on a thread that would end with the app.
#[cfg(unix)]
#[test]
fn a_stop_right_after_a_restart_waits_for_the_replaced_agents_process_group() {
+5 -7
View File
@@ -103,10 +103,9 @@ fn kill_ends_a_running_step() {
);
}
/// A grandchild that ignores hangup is still in the agent's process group
/// (portable-pty starts the agent under `setsid`), so `kill` must reach it
/// through the group once the grace is up. An ordinary grandchild already dies
/// with its shell, when the kernel hangs up the terminal, so it cannot show this.
/// A grandchild that ignores hangup stays in the command's process group, so
/// `kill` must reach it through the group once the grace is up. An ordinary
/// grandchild dies when the kernel hangs up the terminal, so it cannot show this.
#[cfg(unix)]
#[test]
fn kill_ends_a_hangup_ignoring_grandchild_after_the_grace() {
@@ -124,9 +123,8 @@ fn kill_ends_a_hangup_ignoring_grandchild_after_the_grace() {
);
}
/// An agent that ended by itself was never killed, so no grace thread of
/// `kill`'s is there to finish its group: only `end_group` can end the
/// grandchild that ignored the terminal's hangup.
/// A command that exited by itself was never killed, so no `kill` grace thread
/// finishes its group: only `end_group` ends the hangup-ignoring grandchild.
#[cfg(unix)]
#[test]
fn end_group_ends_what_a_command_that_exited_by_itself_left() {
+4 -5
View File
@@ -1,6 +1,5 @@
//! The signals that end the app against the handler that turns them into its quit cleanup. A
//! file of its own, so the handler lives in a test process of its own: without it, a signal below
//! ends the whole process and the run fails. The handler installs once per process, so every
//! Checks that SIGTERM, SIGINT and SIGHUP run the app's quit cleanup. A file of its own, so the
//! handler lives in a test process of its own. The handler installs once per process, so every
//! other case runs in a child: this test binary again, running only `signal_child`.
#![cfg(unix)]
@@ -162,8 +161,8 @@ fn signal_child() {
let Some(case) = std::env::var_os(CHILD) else {
return;
};
// A signal this run was started with ignored (`nohup`, a script's `&`)
// would stay ignored, and no case below means that one.
// Undo signals this run was started with ignored (`nohup`, a script's `&`):
// the handler would leave them ignored, which no case below intends.
for signal in [libc::SIGTERM, libc::SIGINT, libc::SIGHUP] {
// SAFETY: putting a signal's default action back installs no handler.
unsafe { libc::signal(signal, libc::SIG_DFL) };