From b2a5a7077c2ae0c46b67fc9ca7c82ec32a9762bc Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Mon, 28 Jul 2025 10:42:26 +0300 Subject: [PATCH] sqlite3: Fix WAL tests by closing connection Commit ac33ae90 ("core: Enforce single, shared database object per database file") changes the semantics of the WAL because unless we close all the connections, the WAL remains open due to `Database` being kept open in memory. Fix test failures by properly closing the connection between different test cases. --- sqlite3/tests/compat/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sqlite3/tests/compat/mod.rs b/sqlite3/tests/compat/mod.rs index a6aba67c5..9b1b1b56d 100644 --- a/sqlite3/tests/compat/mod.rs +++ b/sqlite3/tests/compat/mod.rs @@ -355,6 +355,7 @@ mod tests { ), SQLITE_OK ); + assert_eq!(sqlite3_close(db), SQLITE_OK); } let mut wal_path = temp_file.path().to_path_buf(); assert!(wal_path.set_extension("db-wal")); @@ -380,6 +381,7 @@ mod tests { assert_eq!(sqlite3_step(stmt), SQLITE_DONE); assert_eq!(sqlite3_finalize(stmt), SQLITE_OK); } + assert_eq!(sqlite3_close(db), SQLITE_OK); } } @@ -459,6 +461,7 @@ mod tests { ), SQLITE_OK ); + assert_eq!(sqlite3_close(db), SQLITE_OK); } let mut wal_path = temp_file.path().to_path_buf(); assert!(wal_path.set_extension("db-wal")); @@ -483,6 +486,7 @@ mod tests { assert_eq!(sqlite3_step(stmt), SQLITE_DONE); assert_eq!(sqlite3_finalize(stmt), SQLITE_OK); } + assert_eq!(sqlite3_close(db), SQLITE_OK); } }