about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/streaming.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/streaming.rs b/src/streaming.rs
index e9804a8..67aa670 100644
--- a/src/streaming.rs
+++ b/src/streaming.rs
@@ -226,7 +226,11 @@ mod tests {
 
     #[test]
     fn mark_failed_appends_failure_marker_with_the_error() {
-        let dir = std::env::temp_dir().join(format!("gn4-streaming-test-{}", std::process::id()));
+        // Each test gets its own directory: these run in parallel, and
+        // the reused-id test below removes its directory when it is done,
+        // which used to delete this one's log mid-assertion.
+        let dir = std::env::temp_dir()
+            .join(format!("gn4-streaming-fail-marker-{}", std::process::id()));
         std::fs::create_dir_all(&dir).unwrap();
         let log = create_run_log(dir.to_str().unwrap(), Some("fail-marker-test")).unwrap();
         mark_failed(&log, &"Rscript died with status 1".to_string());
@@ -264,7 +268,7 @@ mod tests {
     #[test]
     fn create_run_log_rejects_a_reused_id() {
         let cache_dir =
-            std::env::temp_dir().join(format!("gn4-streaming-test-{}", std::process::id()));
+            std::env::temp_dir().join(format!("gn4-streaming-dup-id-{}", std::process::id()));
         let cache_dir = cache_dir.to_str().unwrap();
         std::fs::create_dir_all(cache_dir).unwrap();
         let id = "dup-run";