rustcoreutils/posixutils-rs

fuser::test_fuser_basic fails inconsistently, on Macos

Closed this issue · 2 comments

MacOS cargo test fails sometimes, with the following "PID xxx not found" error. Example test output:


     Running tests/process-tests.rs (target/debug/deps/process_tests-1b1c4950e17f56cb)

running 11 tests
test fuser::test_fuser_with_many_files ... ignored
test xargs::xargs_basic ... ok
test xargs::xargs_with_eofstr ... ok
test xargs::xargs_with_null_delimiter ... ok
test xargs::xargs_trace ... ok
test xargs::xargs_with_null_delimiter_trailing_non_null ... ok
test xargs::xargs_with_maxnum ... ok
test xargs::xargs_with_maxsize ... ok
test fuser::test_fuser_with_user ... ok
test fuser::test_fuser_basic ... FAILED
test fuser::test_fuser_large_directory ... ok

failures:

---- fuser::test_fuser_basic stdout ----
thread 'fuser::test_fuser_basic' panicked at process/tests/fuser/mod.rs:54:9:
PID 33135 not found in the output.
stack backtrace:
   0: rust_begin_unwind
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:665:5
   1: core::panicking::panic_fmt
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:74:14
   2: process_tests::fuser::test_fuser_basic::{{closure}}::{{closure}}
             at ./tests/fuser/mod.rs:54:9
   3: plib::testing::run_test_with_checker
             at /Users/jgarzik/repo/posixutils-rs/plib/src/testing.rs:111:5
   4: process_tests::fuser::fuser_test
             at ./tests/fuser/mod.rs:22:5
   5: process_tests::fuser::test_fuser_basic::{{closure}}
             at ./tests/fuser/mod.rs:51:5
   6: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/future/future.rs:123:9
   7: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/future/future.rs:123:9
   8: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}::{{closure}}
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/scheduler/current_thread/mod.rs:696:57
   9: tokio::runtime::coop::with_budget
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/coop.rs:107:5
  10: tokio::runtime::coop::budget
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/coop.rs:73:5
  11: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/scheduler/current_thread/mod.rs:696:25
  12: tokio::runtime::scheduler::current_thread::Context::enter
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/scheduler/current_thread/mod.rs:423:19
  13: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/scheduler/current_thread/mod.rs:695:36
  14: tokio::runtime::scheduler::current_thread::CoreGuard::enter::{{closure}}
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/scheduler/current_thread/mod.rs:774:68
  15: tokio::runtime::context::scoped::Scoped<T>::set
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/context/scoped.rs:40:9
  16: tokio::runtime::context::set_scheduler::{{closure}}
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/context.rs:180:26
  17: std::thread::local::LocalKey<T>::try_with
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/local.rs:283:12
  18: std::thread::local::LocalKey<T>::with
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/local.rs:260:9
  19: tokio::runtime::context::set_scheduler
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/context.rs:180:9
  20: tokio::runtime::scheduler::current_thread::CoreGuard::enter
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/scheduler/current_thread/mod.rs:774:27
  21: tokio::runtime::scheduler::current_thread::CoreGuard::block_on
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/scheduler/current_thread/mod.rs:683:19
  22: tokio::runtime::scheduler::current_thread::CurrentThread::block_on::{{closure}}
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/scheduler/current_thread/mod.rs:191:28
  23: tokio::runtime::context::runtime::enter_runtime
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/context/runtime.rs:65:16
  24: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/scheduler/current_thread/mod.rs:179:9
  25: tokio::runtime::runtime::Runtime::block_on_inner
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/runtime.rs:361:47
  26: tokio::runtime::runtime::Runtime::block_on
             at /Users/jgarzik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/runtime.rs:335:13
  27: process_tests::fuser::test_fuser_basic
             at ./tests/fuser/mod.rs:51:5
  28: process_tests::fuser::test_fuser_basic::{{closure}}
             at ./tests/fuser/mod.rs:43:28
  29: core::ops::function::FnOnce::call_once
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/ops/function.rs:250:5
  30: core::ops::function::FnOnce::call_once
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    fuser::test_fuser_basic

test result: FAILED. 9 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out; finished in 3.59s

appears to be fixed after #261 (and #264)