Isolate provider test temp paths
- SHA
19b81c538eca0101edbbd9f3d8727762b60deaeb- Parents
-
f110af6 - Tree
a6e4944
19b81c5
19b81c538eca0101edbbd9f3d8727762b60deaebf110af6
a6e4944| Status | File | + | - |
|---|---|---|---|
| M |
src/providers.rs
|
8 | 1 |
src/providers.rsmodified@@ -2425,8 +2425,11 @@ mod tests { | ||
| 2425 | 2425 | use std::{ |
| 2426 | 2426 | cell::RefCell, |
| 2427 | 2427 | collections::{HashMap, VecDeque}, |
| 2428 | + sync::atomic::{AtomicUsize, Ordering}, | |
| 2428 | 2429 | }; |
| 2429 | 2430 | |
| 2431 | + static TEMP_COUNTER: AtomicUsize = AtomicUsize::new(0); | |
| 2432 | + | |
| 2430 | 2433 | fn date(year: i32, month: Month, day: u8) -> CalendarDate { |
| 2431 | 2434 | CalendarDate::from_ymd(year, month, day).expect("valid date") |
| 2432 | 2435 | } |
@@ -2436,8 +2439,12 @@ mod tests { | ||
| 2436 | 2439 | } |
| 2437 | 2440 | |
| 2438 | 2441 | fn temp_path(name: &str) -> PathBuf { |
| 2442 | + let counter = TEMP_COUNTER.fetch_add(1, Ordering::Relaxed); | |
| 2439 | 2443 | 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 | + )) | |
| 2441 | 2448 | .join(name) |
| 2442 | 2449 | } |
| 2443 | 2450 | |