Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions crates/storage/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,13 @@ pub mod test_utils {
#[track_caller]
pub fn create_test_rw_db_with_path<P: AsRef<Path>>(path: P) -> Arc<TempDatabase<DatabaseEnv>> {
let path = path.as_ref().to_path_buf();
let emsg = format!("{ERROR_DB_CREATION}: {path:?}");
let db = init_db(
path.as_path(),
DatabaseArguments::new(ClientVersion::default())
.with_max_read_transaction_duration(Some(MaxReadTransactionDuration::Unbounded)),
)
.expect(ERROR_DB_CREATION);
.expect(&emsg);
Arc::new(TempDatabase::new(db, path))
}

Expand All @@ -201,8 +202,9 @@ pub mod test_utils {
.with_max_read_transaction_duration(Some(MaxReadTransactionDuration::Unbounded));

let path = tempdir_path();
let emsg = format!("{ERROR_DB_CREATION}: {path:?}");
{
init_db(path.as_path(), args.clone()).expect(ERROR_DB_CREATION);
init_db(path.as_path(), args.clone()).expect(&emsg);
}
let db = open_db_read_only(path.as_path(), args).expect(ERROR_DB_OPEN);
Arc::new(TempDatabase::new(db, path))
Expand Down