From aa0d3049581da20e1cda76f609583a39fe8c43ac Mon Sep 17 00:00:00 2001 From: Ryan Duguid Date: Sat, 31 Oct 2026 00:09:16 +1100 Subject: [PATCH] Keep Windows test temporary files on the workspace drive Durable writes on the runner's system drive are slow enough to trip the tests' 1 s and 5 s budgets, which failed a different test on most runs. TEMP and TMP now point at the runner's temp directory on the workspace drive. The MAX_PATH test assumed a long temporary root, so it now builds a path past the limit whatever the root's length. --- .github/workflows/ci.yml | 7 ++++++- src/storage.rs | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6bd6af5..1f52de1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,5 +45,10 @@ jobs: - run: cargo fmt --check - run: cargo clippy --all-targets --locked -- -D warnings # Timing-bounded tests (1 s and 5 s durable-write and retirement budgets) fail closed when the - # runner is contended: Windows runs them serially, Linux on two threads. + # runner is contended: Windows runs them serially, Linux on two threads. Temporary files stay + # on the workspace drive: a durable write's median was 6 to 9 ms on the Windows system drive + # and 0.2 to 0.6 ms there (3 runners, 30 October 2026). - run: cargo test --locked -- --test-threads=${{ matrix.os == 'windows-latest' && 1 || 2 }} + env: + TEMP: ${{ runner.temp }} + TMP: ${{ runner.temp }} diff --git a/src/storage.rs b/src/storage.rs index b810c41..1171538 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -880,7 +880,11 @@ mod lock_race_tests { #[test] fn atomic_records_and_locks_work_beyond_max_path() { let home = tempfile::tempdir().unwrap(); - let deep = home.path().join("PUBLIC-".repeat(30)); + // Two components, so the path passes MAX_PATH however short the temporary root is. + let deep = home + .path() + .join("PUBLIC-".repeat(30)) + .join("PUBLIC-".repeat(30)); fs::create_dir_all(&deep).unwrap(); let record = deep.join("PUBLIC-record.json"); atomic_json(&record, &serde_json::json!({"PUBLIC":1})).unwrap();