From b0bc4a79c94d79ad4a8a86a0e4ca15f12909f853 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 19 Feb 2021 19:38:18 +1000 Subject: [PATCH] Disable conflict failure cleanup on macOS --- zebra-test/src/command.rs | 8 ++++---- zebrad/tests/acceptance.rs | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/zebra-test/src/command.rs b/zebra-test/src/command.rs index fb65ee9c683..1e5fe56ea05 100644 --- a/zebra-test/src/command.rs +++ b/zebra-test/src/command.rs @@ -163,8 +163,8 @@ impl TestChild { /// /// ## BUGS /// - /// On Windows, this function can return `Ok` for processes that have - /// panicked. See #1781. + /// On Windows (and possibly macOS), this function can return `Ok` for + /// processes that have panicked. See #1781. #[spandoc::spandoc] pub fn kill(&mut self) -> Result<()> { /// SPANDOC: Killing child process @@ -363,8 +363,8 @@ impl TestChild { /// /// ## BUGS /// - /// On Windows, this function can return `true` for processes that have - /// panicked. See #1781. + /// On Windows and macOS, this function can return `true` for processes that + /// have panicked. See #1781. pub fn is_running(&mut self) -> bool { matches!(self.child.try_wait(), Ok(None)) } diff --git a/zebrad/tests/acceptance.rs b/zebrad/tests/acceptance.rs index fa21a62506c..33a00491f28 100644 --- a/zebrad/tests/acceptance.rs +++ b/zebrad/tests/acceptance.rs @@ -1223,16 +1223,17 @@ where // In node1 we want to check for the success regex // If there are any errors, we also want to print the node2 output. let output1 = node1.wait_with_output(); - // This mut is only used on cfg(unix), due to #1781. + // This mut is only used on some platforms, due to #1781. #[allow(unused_mut)] let (output1, mut node2) = node2.kill_on_error(output1)?; // node2 should have panicked due to a conflict. Kill it here anyway, so it // doesn't outlive the test on error. // - // This code doesn't work on Windows. It's cleanup code that only runs when - // node2 doesn't panic as expected. So it's ok to skip it. See #1781. - #[cfg(unix)] + // This code doesn't work on Windows or macOS. It's cleanup code that only + // runs when node2 doesn't panic as expected. So it's ok to skip it. + // See #1781. + #[cfg(target_os = "linux")] if node2.is_running() { use color_eyre::eyre::eyre; return node2