Skip to content

Commit

Permalink
Remove flaky test workaround that doesn't work reliably.
Browse files Browse the repository at this point in the history
  • Loading branch information
dimo414 committed Feb 6, 2022
1 parent bc52c2e commit 58e62bb
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ mod cli {
CmdResult { out: "2".into(), err: "".into(), status: Some(1) });
}

// Note: this test has been flaky in the past
#[test]
fn discard_failures_in_background() {
let dir = TestDir::temp();
Expand All @@ -215,11 +216,6 @@ mod cli {
// returns cached result, but attempts to warm in the background
let last_mod = modtime(&file);
make_dir_stale(dir.path("cache"), Duration::from_secs(15)).unwrap();
assert_eq!(run(bkt(dir.path("cache")).args(&discard_stale_args)),
CmdResult { out: "1".into(), err: "".into(), status: Some(1) });
// TODO this third call shouldn't be necessary, but for some reason the modtime assertion
// below fails occasionally even though the file contents check below that indicates the
// write happened. Other tests don't appear to trigger this race.
assert_eq!(run(bkt(dir.path("cache")).args(&discard_stale_args)),
CmdResult { out: "1".into(), err: "".into(), status: Some(1) });

Expand All @@ -229,7 +225,7 @@ mod cli {
}
// Command ran
assert!(modtime(&file) > last_mod, "{:?} !> {:?}", modtime(&file), last_mod);
assert_eq!(std::fs::read_to_string(&file).unwrap(), "...");
assert_eq!(std::fs::read_to_string(&file).unwrap(), "..");

// but cache was not updated
assert_eq!(run(bkt(dir.path("cache")).args(&discard_args)),
Expand Down

0 comments on commit 58e62bb

Please sign in to comment.