From 75806d081f4ee3e7019d84a6e7e233207d979e1d Mon Sep 17 00:00:00 2001 From: Skia Date: Tue, 9 Sep 2025 12:57:45 +0200 Subject: [PATCH] tests: make sure sway's subprocesses are killed before killing sway This fixes the tests when run within Debian's autopkgtest. Since there were still some living child processes, autopkgtest was stuck waiting for them forever. --- tests/utils/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/utils/mod.rs b/tests/utils/mod.rs index daf9319..c25a1ca 100644 --- a/tests/utils/mod.rs +++ b/tests/utils/mod.rs @@ -107,6 +107,10 @@ impl Sway { } fn stop(&mut self) { + // in case some apps were spawned, kill them, and give them some time to be killed + self.send_command(["[all] kill"].as_slice()); + std::thread::sleep(std::time::Duration::from_millis(500)); + // now terminate sway signal(self.process.id(), "TERM"); match self.check_connection("Unable to connect to") { Ok(()) => eprintln!("Sway terminated correctly on its own"),