Skip to content

Commit 690564c

Browse files
committed
Fix flaky test.
FD 3 might not be used already.
1 parent e0b2986 commit 690564c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ mod tests {
284284
let file = File::open("testdata/file1.txt").unwrap();
285285
let file_fd = file.as_raw_fd();
286286
command.preserved_fds(vec![file_fd]);
287-
assert!(file_fd > 3);
287+
assert!(file_fd > 2);
288288

289289
let output = command.output().unwrap();
290290
expect_fds(&output, &[0, 1, 2, 3, file_fd], 0);
@@ -403,7 +403,7 @@ mod tests {
403403
for entry in dir {
404404
let entry = entry.unwrap();
405405
let fd: RawFd = entry.file_name().to_str().unwrap().parse().unwrap();
406-
if fd > 3 {
406+
if fd > 2 {
407407
close(fd).unwrap();
408408
}
409409
}

0 commit comments

Comments
 (0)