From f027c53079f4d99e48e4f6e1d9d1a1fc403e34b9 Mon Sep 17 00:00:00 2001 From: Victor Velazquez Date: Mon, 9 Nov 2026 18:40:32 +0100 Subject: [PATCH] Remove SQLite -wal and -shm files after spec runs Closes #35 --- spec/support/optional/database.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/support/optional/database.rb b/spec/support/optional/database.rb index 6c31df4..c7f306b 100644 --- a/spec/support/optional/database.rb +++ b/spec/support/optional/database.rb @@ -67,7 +67,8 @@ def configuration # own in-memory database, and the concurrency specs run invocations on their own # threads, which check out their own connections. def sqlite_configuration - at_exit { FileUtils.rm_f(SQLITE_PATH) } + # WAL mode (ActiveRecord 8's default) keeps -wal and -shm files beside the database. + at_exit { FileUtils.rm_f(["", "-wal", "-shm"].map { |suffix| "#{SQLITE_PATH}#{suffix}" }) } # timeout: what every generated Rails database.yml sets. Without it SQLite's busy # timeout is zero, and a writer that finds the write lock taken fails at once rather # than waiting its turn — which the chain's concurrency spec exists to prove it does.