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 <rbradford@rivosinc.com>
This commit is contained in:
Rob Bradford 2024-10-21 12:05:51 +01:00
parent bac762e472
commit 36b59a6d2b

View File

@ -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()
}
}