rust-vmm / vmm-sys-util

Helpers and utilities used by multiple rust-vmm components and VMMs
BSD 3-Clause "New" or "Revised" License
79 stars 64 forks source link

Unit Tests fail to pass on my mac #114

Closed Twister915 closed 1 year ago

Twister915 commented 3 years ago

I don't know if it's a project goal for unit tests to work on any platform, but I would imagine it's better if they run on developer machines.

I get the following output when running (macOS Big Sur -- on M1 aarch64 mac mini)

running 38 tests
test errno::tests::test_display ... ok
test fam::tests::test_mem_allocator_len ... ok
test fam::tests::test_raw_content ... ok
test fam::tests::test_new ... ok
test fam::tests::test_entries_slice ... ok
test errno::tests::test_errno ... ok
test fam::tests::test_push ... ok
test fam::tests::test_from_entries ... ok
test fam::tests::test_clone ... ok
test fam::tests::test_reserve ... ok
test fam::tests::test_partial_eq ... ok
test fam::tests::test_set_len ... ok
test fam::tests::test_ser_deser ... ok
test fam::tests::test_wrapper_len ... ok
test fam::tests::test_retain ... ok
test rand::tests::test_rand_alphanumerics_impl ... ok
test rand::tests::test_rand_alphanumerics ... ok
test metric::tests::test_main ... ok
test syscall::tests::test_syscall_ops ... ok
test rand::tests::test_xor_psuedo_rng_u8_alphas ... ok
test rand::tests::test_timestamp_cycles ... FAILED
test rand::tests::test_xor_psuedo_rng_u32 ... FAILED
test tempfile::tests::test_create_file_new ... ok
test tempfile::tests::test_into_file ... ok
test tempfile::tests::test_remove_file ... ok
test tempfile::tests::test_drop_file ... ok
test tempfile::tests::test_create_file_new_in ... ok
test unix::file_traits::tests::test_set_len ... ok
test unix::file_traits::tests::test_set_len_fails_when_file_not_opened_for_writing ... ok
test tempfile::tests::test_create_file_with_prefix ... ok
test unix::tempdir::tests::test_create_dir ... FAILED
test unix::tempdir::tests::test_create_dir_in ... FAILED
test unix::tempdir::tests::test_drop ... ok
test unix::tempdir::tests::test_create_dir_with_prefix ... ok
test unix::terminal::tests::test_a_non_tty ... ok
test unix::terminal::tests::test_a_tty ... ok
test unix::tempdir::tests::test_remove_dir ... ok
test unix::file_traits::tests::test_fsync ... ok

failures:

---- rand::tests::test_timestamp_cycles stdout ----
thread 'rand::tests::test_timestamp_cycles' panicked at 'assertion failed: timestamp_cycles() < timestamp_cycles()', src/rand.rs:96:13

---- rand::tests::test_xor_psuedo_rng_u32 stdout ----
thread 'rand::tests::test_xor_psuedo_rng_u32' panicked at 'assertion failed: `(left != right)`
  left: `3767613165`,
 right: `3767613165`', src/rand.rs:103:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- unix::tempdir::tests::test_create_dir stdout ----
thread 'unix::tempdir::tests::test_create_dir' panicked at 'assertion failed: path.starts_with(\"/tmp/\")', src/unix/tempdir.rs:149:9

---- unix::tempdir::tests::test_create_dir_in stdout ----
thread 'unix::tempdir::tests::test_create_dir_in' panicked at 'assertion failed: path.starts_with(\"/tmp/\")', src/unix/tempdir.rs:190:9

failures:
    rand::tests::test_timestamp_cycles
    rand::testerror: io error when listing tests: Os { code: 35, kind: WouldBlock, message: "Resource temporarily unavailable" }
s::test_xor_psuedo_rng_u32
error: test failed, to rerun pass '--lib'
andreeaflorescu commented 3 years ago

@Twister915 Thanks for reporting this. Your setup is not something that we test for. The CI is only testing for Linux on x86_64 & aarch64, and Windows x86_64. It does look like there are some missing conditional compilation macros. Are you interested in adding them?

Twister915 commented 3 years ago

@andreeaflorescu Yeah, for sure, I'm happy to take a look later tonight.

andreeaflorescu commented 3 years ago

@andreeaflorescu Yeah, for sure, I'm happy to take a look later tonight.

Cool, thanks! Let us know if you need help.

alxiord commented 1 year ago

Closing due to inactivity. Please reopen if it comes back into focus.