about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-06 13:36:09 +0000
committerPjotr <wrk@bosa.lan>2026-11-06 13:36:09 +0000
commit59d4d073551209a00a21782f8f1bb9ce202333de (patch)
treea5b37112be4f4806d32e7b00ca2a0c32fb20f750 /src
parent3cfacfc429451d39db96fe57904db9bb04ed18d1 (diff)
downloadgenenetwork4-59d4d073551209a00a21782f8f1bb9ce202333de.tar.gz
streaming: stop two tests sharing (and deleting) one temp dir
mark_failed_appends_failure_marker_with_the_error and
create_run_log_rejects_a_reused_id both worked in
/tmp/gn4-streaming-test-<pid>, and the second removes the directory when
it is done, so under cargo's parallel test threads it could delete the
first one's log mid-assertion -- an intermittent failure that has
nothing to do with either test's subject. Give each its own directory.
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";