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"));