mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-22 16:35:30 +01:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user