Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions tests/by-util/test_tail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@
clippy::cast_possible_truncation
)]

#[cfg(all(
not(target_vendor = "apple"),
not(target_os = "windows"),
not(target_os = "android"),
not(target_os = "freebsd")
))]
use nix::sys::signal::{Signal, kill};
#[cfg(all(
not(target_vendor = "apple"),
not(target_os = "windows"),
not(target_os = "android"),
not(target_os = "freebsd")
))]
use nix::unistd::Pid;
use pretty_assertions::assert_eq;
use rand::distr::Alphanumeric;
use rstest::rstest;
Expand Down Expand Up @@ -679,7 +693,7 @@ fn test_follow_invalid_pid() {
));
}

// FixME: test PASSES for usual windows builds, but fails for coverage testing builds (likely related to the specific RUSTFLAGS '-Zpanic_abort_tests -Cpanic=abort') This test also breaks tty settings under bash requiring a 'stty sane' or reset. // spell-checker:disable-line
// FixME: test PASSES for usual windows builds, but fails for coverage testing builds (likely related to the specific RUSTFLAGS '-Zpanic_abort_tests -Cpanic=abort') // spell-checker:disable-line
// FIXME: FreeBSD: See issue https://github.com/uutils/coreutils/issues/4306
// Fails intermittently in the CI, but couldn't reproduce the failure locally.
#[test]
Expand All @@ -694,12 +708,7 @@ fn test_follow_with_pid() {

let (at, mut ucmd) = at_and_ucmd!();

#[cfg(unix)]
let dummy_cmd = "sh";

#[cfg(windows)]
let dummy_cmd = "cmd";

let mut dummy = Command::new(dummy_cmd).spawn().unwrap();
let pid = dummy.id();

Expand Down Expand Up @@ -734,7 +743,7 @@ fn test_follow_with_pid() {
.stdout_only_fixture("foobar_follow_multiple_appended.expected");

// kill the dummy process and give tail time to notice this
dummy.kill().unwrap();
kill(Pid::from_raw(i32::try_from(pid).unwrap()), Signal::SIGUSR1).unwrap();
let _ = dummy.wait();

child.delay(DEFAULT_SLEEP_INTERVAL_MILLIS);
Expand Down
Loading