From 2cd2ae9995f576a3cca6a0642325b2772d8d43bd Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Mon, 7 Oct 2019 07:02:02 -0400 Subject: [PATCH] Fix issues with delete on start Seems like Windows doesn't handle it properly? --- src/client/cnc_descriptor.rs | 5 ++++- src/driver.rs | 12 +++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/client/cnc_descriptor.rs b/src/client/cnc_descriptor.rs index 3ea3e88..ff001ec 100644 --- a/src/client/cnc_descriptor.rs +++ b/src/client/cnc_descriptor.rs @@ -85,10 +85,13 @@ mod tests { #[test] fn read_cnc_version() { + let temp_dir = tempdir().unwrap(); + let dir = temp_dir.path().to_path_buf(); + temp_dir.close(); + let dir = tempdir().unwrap().into_path(); let _driver = DriverContext::default() .set_aeron_dir(&dir) - .set_dir_delete_on_start(true) .build() .unwrap(); diff --git a/src/driver.rs b/src/driver.rs index 2918386..43cdc3f 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -171,10 +171,12 @@ mod tests { #[test] fn multiple_startup_failure() { - let dir = tempdir().unwrap().into_path(); + let temp_dir = tempdir().unwrap(); + let dir = temp_dir.path().to_path_buf(); + temp_dir.close(); + let driver = DriverContext::default() .set_aeron_dir(&dir) - .set_dir_delete_on_start(true) .build() .unwrap(); @@ -207,12 +209,12 @@ mod tests { #[test] fn single_duty_cycle() { - let tempdir = tempfile::tempdir().unwrap(); - let path = tempdir.into_path(); + let temp_dir = tempdir().unwrap(); + let path = temp_dir.path().to_path_buf(); + tempdir.close(); let driver = DriverContext::default() .set_aeron_dir(&path) - .set_dir_delete_on_start(true) .build() .expect("Unable to create media driver") .start()