From c6ca6f2b8ebb9da1b6a11a5697bc37801f82672c Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Thu, 23 Nov 2023 09:26:00 -0500 Subject: [PATCH] fix test for file send The test is broken because we can't really guarantee that the old fd will fail to open. It is entirely possible that by now, some other test (remember tests are threaded) have opened a new file for itself that ended up with the same fd as original_fd. This test was always failing for me when I ran "cargo test" but always succeeding if I ran the test in isolation, which confirms that this is the likely cause. --- glommio/src/io/dma_file.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/glommio/src/io/dma_file.rs b/glommio/src/io/dma_file.rs index a535ce068..dec67c4ba 100644 --- a/glommio/src/io/dma_file.rs +++ b/glommio/src/io/dma_file.rs @@ -780,7 +780,6 @@ pub(crate) mod test { }; use futures::join; use futures_lite::{stream, StreamExt}; - use nix::fcntl::{fcntl, FcntlArg::F_GETFD}; use rand::{seq::SliceRandom, thread_rng}; use std::{cell::RefCell, convert::TryInto, path::PathBuf, time::Duration}; @@ -1547,8 +1546,6 @@ pub(crate) mod test { .join() .unwrap(); - assert_eq!(fcntl(original_fd, F_GETFD), Err(nix::errno::Errno::EBADF)); - let file: DmaFile = result.into(); assert_ne!(file.as_raw_fd(), original_fd); assert_eq!(file.file.inode, original_inode);