From 958efaa3d826cdc067fe9f357e5db41ce23141ee Mon Sep 17 00:00:00 2001 From: Shailendra Singh Date: Fri, 30 Oct 2026 13:47:50 -0700 Subject: [PATCH] test(windows): backport server test repairs from #4862 Reduce the SQLite concurrency fixture to five iterations per writer on Windows so slow fsync does not exhaust the busy timeout. Hold mutation stress-test locks until a wall-clock deadline rather than depending on Windows timer granularity. Retain Windows' existing portable supervisor fixtures. The isolation validation modules changed by #4862 are not present on this branch. Native Windows ARM64 validation: 6630 tests passed, 41 skipped, 0 failed. Backported from commit 92434dcb2b6248ac827df05c00551fe7a1fedf17. Signed-off-by: Shailendra Singh --- crates/openshell-server/src/compute/mutation_guard.rs | 6 +++++- crates/openshell-server/src/persistence/tests.rs | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/openshell-server/src/compute/mutation_guard.rs b/crates/openshell-server/src/compute/mutation_guard.rs index b6de87190b..e5ce30cbbe 100644 --- a/crates/openshell-server/src/compute/mutation_guard.rs +++ b/crates/openshell-server/src/compute/mutation_guard.rs @@ -1164,7 +1164,11 @@ mod tests { if op.is_distributed() { fleet.enter(op); } - tokio::time::sleep(hold).await; + // Windows timers round a 1 ms sleep up to ~16 ms, so yield instead. + let until = std::time::Instant::now() + hold; + while std::time::Instant::now() < until { + tokio::task::yield_now().await; + } if op.is_distributed() { fleet.leave(op); } diff --git a/crates/openshell-server/src/persistence/tests.rs b/crates/openshell-server/src/persistence/tests.rs index 93a1d94c8e..42e27690b8 100644 --- a/crates/openshell-server/src/persistence/tests.rs +++ b/crates/openshell-server/src/persistence/tests.rs @@ -2298,7 +2298,8 @@ async fn sqlite_concurrent_writes_return_their_own_resource_version() { use std::sync::Arc; const WRITERS: u64 = 8; - const WRITES: u64 = 25; + // Slow Windows fsync can starve a writer past the SQLite busy timeout. + const WRITES: u64 = if cfg!(windows) { 5 } else { 25 }; let tmp = tempfile::tempdir().expect("tempdir"); let url = on_disk_store_url(&tmp.path().join("openshell.db"));