From 67ea72831ee78fef2f426a02dcba9c78ba2aa3b8 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Wed, 6 Dec 2023 01:49:03 -0500 Subject: [PATCH] `tests`: use different vars for compressing test files 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. --- tests/test_joinp.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/test_joinp.rs b/tests/test_joinp.rs index b3fef95b2..dd86be888 100644 --- a/tests/test_joinp.rs +++ b/tests/test_joinp.rs @@ -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 }