Skip to content

many test failures in tests/dir.rs on Linux #69

@decathorpe

Description

@decathorpe

I'm responsible for maintaining the Fedora Linux packages for many Rust crates, the fs_extra crate among them. I tried updating our package to the recently released v1.3.0, but it appears that the test suite produces a lot of errors (all of which originating in tests/dir.rs):

failures:

---- it_copy_progress_work stdout ----
thread 'it_copy_progress_work' panicked at 'assertion failed: `(left == right)`
  left: `55`,
 right: `57`', tests/dir.rs:853:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- it_copy_with_progress_inside_no_overwrite_work_target_dir_exist_with_source_dir_exist stdout ----
thread 'it_copy_with_progress_inside_no_overwrite_work_target_dir_exist_with_source_dir_exist' panicked at 'assertion failed: `(left == right)`
  left: `57`,
 right: `59`', tests/dir.rs:3970:21

---- it_copy_with_progress_inside_work_target_dir_exist_with_no_source_dir_named_sub_dir stdout ----
thread 'it_copy_with_progress_inside_work_target_dir_exist_with_no_source_dir_named_sub_dir' panicked at 'assertion failed: `(left == right)`
  left: `57`,
 right: `59`', tests/dir.rs:3881:21

---- it_copy_with_progress_inside_work_target_dir_not_exist stdout ----
thread 'it_copy_with_progress_inside_work_target_dir_not_exist' panicked at 'assertion failed: `(left == right)`
  left: `55`,
 right: `57`', tests/dir.rs:3800:21

---- it_copy_with_progress_inside_overwrite_work_target_dir_exist_with_source_dir_exist stdout ----
thread 'it_copy_with_progress_inside_overwrite_work_target_dir_exist_with_source_dir_exist' panicked at 'assertion failed: `(left == right)`
  left: `57`,
 right: `59`', tests/dir.rs:4058:21

---- it_get_dir_content stdout ----
thread 'it_get_dir_content' panicked at 'assertion failed: `(left == right)`
  left: `56`,
 right: `58`', tests/dir.rs:2936:5

---- it_copy_with_progress_work_dif_buf_size stdout ----
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `56`,
 right: `58`', tests/dir.rs:980:13
thread 'it_copy_with_progress_work_dif_buf_size' panicked at 'assertion failed: `(left == right)`
  left: `56`,
 right: `58`', tests/dir.rs:1002:9

---- it_get_dir_content_many_levels stdout ----
thread 'it_get_dir_content_many_levels' panicked at 'assertion failed: `(left == right)`
  left: `140`,
 right: `202`', tests/dir.rs:2998:5

---- it_move_dir_with_progress_inside_no_overwrite_work_target_dir_exist_with_source_dir_exist stdout ----
thread 'it_move_dir_with_progress_inside_no_overwrite_work_target_dir_exist_with_source_dir_exist' panicked at 'assertion failed: `(left == right)`
  left: `57`,
 right: `59`', tests/dir.rs:4632:21

---- it_move_dir_with_progress_inside_work_target_dir_exist_with_no_source_dir_named_sub_dir stdout ----
thread 'it_move_dir_with_progress_inside_work_target_dir_exist_with_no_source_dir_named_sub_dir' panicked at 'assertion failed: `(left == right)`
  left: `57`,
 right: `59`', tests/dir.rs:4533:21

---- it_move_dir_with_progress_inside_work_target_dir_not_exist stdout ----
thread 'it_move_dir_with_progress_inside_work_target_dir_not_exist' panicked at 'assertion failed: `(left == right)`
  left: `55`,
 right: `57`', tests/dir.rs:4446:21

---- it_move_dir_with_progress_inside_overwrite_work_target_dir_exist_with_source_dir_exist stdout ----
thread 'it_move_dir_with_progress_inside_overwrite_work_target_dir_exist_with_source_dir_exist' panicked at 'assertion failed: `(left == right)`
  left: `57`,
 right: `59`', tests/dir.rs:4727:21

---- it_move_progress_work stdout ----
thread 'it_move_progress_work' panicked at 'assertion failed: `(left == right)`
  left: `55`,
 right: `57`', tests/dir.rs:2357:21

---- it_move_with_progress_work_dif_buf_size stdout ----
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `56`,
 right: `58`', tests/dir.rs:2501:13
thread 'it_move_with_progress_work_dif_buf_size' panicked at 'assertion failed: `(left == right)`
  left: `56`,
 right: `58`', tests/dir.rs:2523:9


failures:
    it_copy_progress_work
    it_copy_with_progress_inside_no_overwrite_work_target_dir_exist_with_source_dir_exist
    it_copy_with_progress_inside_overwrite_work_target_dir_exist_with_source_dir_exist
    it_copy_with_progress_inside_work_target_dir_exist_with_no_source_dir_named_sub_dir
    it_copy_with_progress_inside_work_target_dir_not_exist
    it_copy_with_progress_work_dif_buf_size
    it_get_dir_content
    it_get_dir_content_many_levels
    it_move_dir_with_progress_inside_no_overwrite_work_target_dir_exist_with_source_dir_exist
    it_move_dir_with_progress_inside_overwrite_work_target_dir_exist_with_source_dir_exist
    it_move_dir_with_progress_inside_work_target_dir_exist_with_no_source_dir_named_sub_dir
    it_move_dir_with_progress_inside_work_target_dir_not_exist
    it_move_progress_work
    it_move_with_progress_work_dif_buf_size

test result: FAILED. 68 passed; 14 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

I originally saw these failures in our containerized build environment (which has limited OS access in some ways), but I also reproduced it by just cloning this git repo and just running cargo test.

Tracing back the errors to where they originate in test sources, it appears that the calculation of expected total directory size is off - the assertion failures seem to point to lines like assert_eq!(get_dir_size() * 2 + 17, process_info.total_bytes);. I don't understand what this assertion does, but in most cases, it seems to be off by 2 (or in one case, by 62).


Additional information:

  • Operating system: Fedora Linux 37 and Rawhide on Linux 6.1.9 (or newer)
  • rust 1.67.0 stable and 1.69.0-nightly (f3126500f 2023-02-02)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions