Skip to content

Commit b54d422

Browse files
authored
Auto merge of #471 - jrmuizel:fd-close, r=mstange
Remove filedescriptor test_consumed This test was failing intermittently on github actions. There's no safe way to check that a file descriptor has been closed, because a new file could have been reopened with the same number. We'd then end up closing that new file instead of having close() fail.
2 parents e231cb7 + 91ff2cb commit b54d422

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

core-foundation/src/filedescriptor.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,22 +113,6 @@ mod test {
113113
use libc::O_RDWR;
114114
use runloop::{CFRunLoop};
115115

116-
#[test]
117-
fn test_consumed() {
118-
let path = CString::new("/dev/null").unwrap();
119-
let raw_fd = unsafe { libc::open(path.as_ptr(), O_RDWR, 0) };
120-
let cf_fd = CFFileDescriptor::new(raw_fd, true, never_callback, None);
121-
assert!(cf_fd.is_some());
122-
let cf_fd = cf_fd.unwrap();
123-
124-
assert!(cf_fd.valid());
125-
cf_fd.invalidate();
126-
assert!(!cf_fd.valid());
127-
128-
// close() should fail
129-
assert_eq!(unsafe { libc::close(raw_fd) }, -1);
130-
}
131-
132116
#[test]
133117
fn test_unconsumed() {
134118
let path = CString::new("/dev/null").unwrap();

0 commit comments

Comments
 (0)