Disarm timeout fixture guards through their mutable receiver

Replace both direct field assignments with a FixtureTree method so guard state mutation is explicit and avoids the captured-field unused-assignment warning under warnings-as-errors Clippy. Preserve disarming before result delivery and after the descendant-death assertion.

Signed-off-by: seiler <seiler@squareup.com>
Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Brad Seiler <seiler@squareup.com>
This commit is contained in:
seiler
2026-10-21 22:45:14 +00:00
committed by Brad Seiler
parent 88aaa4d210
commit 51b8e9c30f

View File

@@ -594,6 +594,11 @@ mod tests {
child: Option<BoundedChild>,
armed: bool,
}
impl FixtureTree {
fn disarm(&mut self) {
self.armed = false;
}
}
impl Drop for FixtureTree {
fn drop(&mut self) {
if self.armed {
@@ -677,7 +682,7 @@ mod tests {
worker.child.as_mut().expect("owned fixture"),
Duration::from_millis(300),
);
worker.armed = false;
worker.disarm();
let _ = tx.send((descendant_pid, result));
});
let (descendant_pid, result) = rx
@@ -694,7 +699,7 @@ mod tests {
!pid_alive(descendant_pid),
"backgrounded descendant {descendant_pid} must be group-killed on timeout, but it survived"
);
fixture.armed = false;
fixture.disarm();
}
// Deterministic seam regression (Thufir's finding): a drain fed a reader