Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion crates/openshell-server/src/compute/mutation_guard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 2 additions & 1 deletion crates/openshell-server/src/persistence/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
Loading