From 5248c60bdad8d66d1130a8aba10f82c2a5ab84ed Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Thu, 1 Aug 2019 14:16:40 -0600 Subject: [PATCH] test only delete temp path if exist --- rust/datafusion/src/execution/physical_plan/projection.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rust/datafusion/src/execution/physical_plan/projection.rs b/rust/datafusion/src/execution/physical_plan/projection.rs index 8522e101a6abd..6e8872300d1d8 100644 --- a/rust/datafusion/src/execution/physical_plan/projection.rs +++ b/rust/datafusion/src/execution/physical_plan/projection.rs @@ -142,6 +142,7 @@ mod tests { use std::fs::File; use std::io::prelude::*; use std::io::{BufReader, BufWriter}; + use std::path::Path; #[test] fn project_first_column() -> Result<()> { @@ -193,7 +194,10 @@ mod tests { let mut dir = env::temp_dir(); dir.push(&format!("{}-{}", filename, partitions)); - fs::remove_dir_all(dir.clone()).unwrap(); + + if Path::new(&dir).exists() { + fs::remove_dir_all(&dir).unwrap(); + } fs::create_dir(dir.clone()).unwrap(); let mut writers = vec![];