Disable conflict failure cleanup on macOS
This commit is contained in:
parent
af12f20732
commit
b0bc4a79c9
|
|
@ -163,8 +163,8 @@ impl<T> TestChild<T> {
|
||||||
///
|
///
|
||||||
/// ## BUGS
|
/// ## BUGS
|
||||||
///
|
///
|
||||||
/// On Windows, this function can return `Ok` for processes that have
|
/// On Windows (and possibly macOS), this function can return `Ok` for
|
||||||
/// panicked. See #1781.
|
/// processes that have panicked. See #1781.
|
||||||
#[spandoc::spandoc]
|
#[spandoc::spandoc]
|
||||||
pub fn kill(&mut self) -> Result<()> {
|
pub fn kill(&mut self) -> Result<()> {
|
||||||
/// SPANDOC: Killing child process
|
/// SPANDOC: Killing child process
|
||||||
|
|
@ -363,8 +363,8 @@ impl<T> TestChild<T> {
|
||||||
///
|
///
|
||||||
/// ## BUGS
|
/// ## BUGS
|
||||||
///
|
///
|
||||||
/// On Windows, this function can return `true` for processes that have
|
/// On Windows and macOS, this function can return `true` for processes that
|
||||||
/// panicked. See #1781.
|
/// have panicked. See #1781.
|
||||||
pub fn is_running(&mut self) -> bool {
|
pub fn is_running(&mut self) -> bool {
|
||||||
matches!(self.child.try_wait(), Ok(None))
|
matches!(self.child.try_wait(), Ok(None))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1223,16 +1223,17 @@ where
|
||||||
// In node1 we want to check for the success regex
|
// In node1 we want to check for the success regex
|
||||||
// If there are any errors, we also want to print the node2 output.
|
// If there are any errors, we also want to print the node2 output.
|
||||||
let output1 = node1.wait_with_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)]
|
#[allow(unused_mut)]
|
||||||
let (output1, mut node2) = node2.kill_on_error(output1)?;
|
let (output1, mut node2) = node2.kill_on_error(output1)?;
|
||||||
|
|
||||||
// node2 should have panicked due to a conflict. Kill it here anyway, so it
|
// node2 should have panicked due to a conflict. Kill it here anyway, so it
|
||||||
// doesn't outlive the test on error.
|
// doesn't outlive the test on error.
|
||||||
//
|
//
|
||||||
// This code doesn't work on Windows. It's cleanup code that only runs when
|
// This code doesn't work on Windows or macOS. It's cleanup code that only
|
||||||
// node2 doesn't panic as expected. So it's ok to skip it. See #1781.
|
// runs when node2 doesn't panic as expected. So it's ok to skip it.
|
||||||
#[cfg(unix)]
|
// See #1781.
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
if node2.is_running() {
|
if node2.is_running() {
|
||||||
use color_eyre::eyre::eyre;
|
use color_eyre::eyre::eyre;
|
||||||
return node2
|
return node2
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue