Skip to content

Commit

Permalink
Disable conflict failure cleanup on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Feb 19, 2021
1 parent af12f20 commit b0bc4a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions zebra-test/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ impl<T> TestChild<T> {
///
/// ## 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
Expand Down Expand Up @@ -363,8 +363,8 @@ impl<T> TestChild<T> {
///
/// ## 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))
}
Expand Down
9 changes: 5 additions & 4 deletions zebrad/tests/acceptance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b0bc4a7

Please sign in to comment.