Skip to content

Commit

Permalink
tests: use different vars for compressing test files
Browse files Browse the repository at this point in the history
Snappy compress creates temp files, and on windows, its flaky for some reason. Instead of using shadow vars, just use new vars just in case vars are not being properly dropped until var is dropped. Also explicitly dropped cmd var just in case tempfiles are not destroyed until cmd is dropped.
  • Loading branch information
jqnatividad committed Dec 6, 2023
1 parent 01926b5 commit 67ea728
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/test_joinp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,14 @@ fn setup(name: &str) -> Workdir {
.arg("cities.csv")
.args(["--output", &out_file]);
wrk.assert_success(&mut cmd);
drop(cmd);

let out_file = wrk.path("places.csv.sz").to_string_lossy().to_string();
let mut cmd = wrk.command("snappy");
cmd.arg("compress")
let out_file2 = wrk.path("places.csv.sz").to_string_lossy().to_string();
let mut cmd2 = wrk.command("snappy");
cmd2.arg("compress")
.arg("places.csv")
.args(["--output", &out_file]);
wrk.assert_success(&mut cmd);
.args(["--output", &out_file2]);
wrk.assert_success(&mut cmd2);

wrk
}
Expand Down

0 comments on commit 67ea728

Please sign in to comment.