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.
This commit is contained in:
Pekka Enberg
2025-07-28 10:42:26 +03:00
parent aca6ffa042
commit b2a5a7077c

View File

@@ -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);
}
}