Skip to content

Commit cd6b96b

Browse files
committed
fix(test): exclude more File-bsaed test cases from miri
Miri sometimes non-deterministically has its mocks for read(2)/write(2) do only partial reads/writes, which our unittests cannot deal with. See also commit 029c652 ("fix(test): do not try to read files under miri"). Mark these test cases as cfg(not(miri)). Signed-off-by: Patrick Roy <[email protected]>
1 parent 629cde9 commit cd6b96b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/mmap/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,12 +449,14 @@ mod tests {
449449
let gm_list = [gm, gm_backed_by_file];
450450
for gm in gm_list.iter() {
451451
let addr = GuestAddress(0x1010);
452+
#[cfg(not(miri))]
452453
let mut file = if cfg!(target_family = "unix") {
453454
File::open(Path::new("/dev/zero")).unwrap()
454455
} else {
455456
File::open(Path::new("c:\\Windows\\system32\\ntoskrnl.exe")).unwrap()
456457
};
457458
gm.write_obj(!0u32, addr).unwrap();
459+
#[cfg(not(miri))]
458460
gm.read_exact_volatile_from(addr, &mut file, mem::size_of::<u32>())
459461
.unwrap();
460462
let value: u32 = gm.read_obj(addr).unwrap();

0 commit comments

Comments
 (0)