Skip to content

e2e::directories::dep_on_current_directory spontaneous failure #133

@GrigorenkoPV

Description

@GrigorenkoPV

Got this spontaneous failure, cannot reproduce:

---- e2e::directories::dep_on_current_directory stdout ----

thread 'e2e::directories::dep_on_current_directory' panicked at tests/e2e/directories.rs:21:5:
assertion `left == right` failed
  left: [98, 117, 105, 108, 100, 46, 110, 105, 110, 106, 97, 10, 102, 111, 111, 10, 111, 117, 116, 10]
 right: [98, 117, 105, 108, 100, 46, 110, 105, 110, 106, 97, 10, 102, 111, 111, 10, 102, 111, 111, 50, 10, 111, 117, 116, 10]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The bytes are, correspondingly,

b"build.ninja\nfoo\nout\n"

and

b"build.ninja\nfoo\nfoo2\nout\n"

The code in question:

#[cfg(unix)]
#[test]
fn dep_on_current_directory() -> anyhow::Result<()> {
let space = TestSpace::new()?;
space.write(
"build.ninja",
"
rule list_files
command = ls $in > $out
build out: list_files .
",
)?;
space.write("foo", "")?;
space.run_expect(&mut n2_command(vec!["out"]))?;
assert_eq!(space.read("out")?, b"build.ninja\nfoo\nout\n");
space.write("foo2", "")?;
space.run_expect(&mut n2_command(vec!["out"]))?;
assert_eq!(space.read("out")?, b"build.ninja\nfoo\nfoo2\nout\n");

Maybe a race condition between tests or a buffer did not get flushed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions