From 36b59a6d2bd841ad4f479e0237daa30d27c02ea6 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Mon, 21 Oct 2024 12:05:51 +0100 Subject: [PATCH] test_infra: Silence warnings about zombie spawned processes --> test_infra/src/lib.rs:1307:25 | 1307 | let child = self | _________________________^ 1308 | | .command 1309 | | .stderr(Stdio::piped()) 1310 | | .stdout(Stdio::piped()) 1311 | | .spawn() 1312 | | .unwrap(); | |_________________________^ | = note: consider calling `.wait()` = note: not doing so might leave behind zombie processes = note: see https://doc.rust-lang.org/stable/std/process/struct.Child.html#warning = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zombie_processes = note: `#[warn(clippy::zombie_processes)]` on by default The API caller should ensure that they call .wait() or equivalent on the spawned child to reap it. Signed-off-by: Rob Bradford --- test_infra/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test_infra/src/lib.rs b/test_infra/src/lib.rs index 79210e9eb..35cf35b49 100644 --- a/test_infra/src/lib.rs +++ b/test_infra/src/lib.rs @@ -1304,6 +1304,9 @@ impl<'a> GuestCommand<'a> { } if self.capture_output { + // The caller should call .wait() on the returned child + #[allow(unknown_lints)] + #[allow(clippy::zombie_processes)] let child = self .command .stderr(Stdio::piped()) @@ -1333,6 +1336,9 @@ impl<'a> GuestCommand<'a> { )) } } else { + // The caller should call .wait() on the returned child + #[allow(unknown_lints)] + #[allow(clippy::zombie_processes)] self.command.spawn() } }