tenseleyflow/rcal / 19b81c5

Browse files

Isolate provider test temp paths

Authored by espadonne
SHA
19b81c538eca0101edbbd9f3d8727762b60deaeb
Parents
f110af6
Tree
a6e4944

1 changed file

StatusFile+-
M src/providers.rs 8 1
src/providers.rsmodified
@@ -2425,8 +2425,11 @@ mod tests {
24252425
     use std::{
24262426
         cell::RefCell,
24272427
         collections::{HashMap, VecDeque},
2428
+        sync::atomic::{AtomicUsize, Ordering},
24282429
     };
24292430
 
2431
+    static TEMP_COUNTER: AtomicUsize = AtomicUsize::new(0);
2432
+
24302433
     fn date(year: i32, month: Month, day: u8) -> CalendarDate {
24312434
         CalendarDate::from_ymd(year, month, day).expect("valid date")
24322435
     }
@@ -2436,8 +2439,12 @@ mod tests {
24362439
     }
24372440
 
24382441
     fn temp_path(name: &str) -> PathBuf {
2442
+        let counter = TEMP_COUNTER.fetch_add(1, Ordering::Relaxed);
24392443
         env::temp_dir()
2440
-            .join(format!("rcal-provider-test-{}", std::process::id()))
2444
+            .join(format!(
2445
+                "rcal-provider-test-{}-{counter}",
2446
+                std::process::id()
2447
+            ))
24412448
             .join(name)
24422449
     }
24432450