Skip to content

Commit 0f6ddbe

Browse files
committed
test(server): scale the SQLite concurrent-write test for Windows fsync
sqlite_concurrent_writes_return_their_own_resource_version (#4408) runs 8 writers that each make 25 unconditional and 25 version-checked writes against one row of an on-disk WAL database with synchronous=FULL. Writers serialize on the SQLite write lock and wait out sqlx's default 5s busy_timeout. Prior to this change, the per-commit fsync cost on the Windows runners was high enough that a waiting writer starved past that timeout and failed with "database is locked" after about 7s. Now, each writer makes 5 writes on Windows and 25 elsewhere. The test still races every writer on the same row, which is what it checks. Signed-off-by: Kris Hicks <khicks@nvidia.com>
1 parent 30f1a37 commit 0f6ddbe

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • crates/openshell-server/src/persistence

‎crates/openshell-server/src/persistence/tests.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2379,7 +2379,8 @@ async fn sqlite_concurrent_writes_return_their_own_resource_version() {
23792379
use std::sync::Arc;
23802380

23812381
const WRITERS: u64 = 8;
2382-
const WRITES: u64 = 25;
2382+
// Slow Windows fsync can starve a writer past the SQLite busy timeout.
2383+
const WRITES: u64 = if cfg!(windows) { 5 } else { 25 };
23832384

23842385
let tmp = tempfile::tempdir().expect("tempdir");
23852386
let url = on_disk_store_url(&tmp.path().join("openshell.db"));

0 commit comments

Comments
 (0)