nix-rust/nix

Debug `mount::test_mount::test_mount_bind` on Linux

SteveLauC opened this issue · 4 comments

failures:

---- mount::test_mount::test_mount_bind stdout ----
thread 'mount::test_mount::test_mount_bind' panicked at 'umount failed: EBUSY: Device or resource busy', test/mount/test_mount.rs:172:33
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

full log: https://github.com/nix-rust/nix/actions/runs/8673165857/job/23784229944?pr=2367

Shouldn't we take the FORK_MTX? forking a process is duplicating all file descriptors, so the "test" file could be open in a child process when we try yo unmount

indeed, we are forking in test_mount_tmpfs_without_flags_allows_rwx and test_mount::test_mount_noexec_disallows_exec. these tests are likely to be executed in parallel with test_mount_bind

#2386 fixed it for me, verified by letting while cargo test --tests --release --all-features -- mount; do : ; done run a (short) while