From b6d71cbeba3c38a4ef7344c4dd8a501bb3ea6568 Mon Sep 17 00:00:00 2001 From: Benjamin Kampmann Date: Mon, 2 May 2022 16:29:50 +0200 Subject: [PATCH] fix(benchmarks): keep the temprorary dir until end of tests --- benchmarks/benches/crypto_bench.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/benchmarks/benches/crypto_bench.rs b/benchmarks/benches/crypto_bench.rs index 59017d64b..aa835ff20 100644 --- a/benchmarks/benches/crypto_bench.rs +++ b/benchmarks/benches/crypto_bench.rs @@ -71,7 +71,7 @@ pub fn keys_query(c: &mut Criterion) { }); let dir = tempfile::tempdir().unwrap(); - let store = Box::new(SledCryptoStore::open_with_passphrase(dir, None).unwrap()); + let store = Box::new(SledCryptoStore::open_with_passphrase(dir.path(), None).unwrap()); let machine = runtime.block_on(OlmMachine::with_store(alice_id(), alice_device_id(), store)).unwrap(); @@ -118,7 +118,8 @@ pub fn keys_claiming(c: &mut Criterion) { b.iter_batched( || { let dir = tempfile::tempdir().unwrap(); - let store = Box::new(SledCryptoStore::open_with_passphrase(dir, None).unwrap()); + let store = + Box::new(SledCryptoStore::open_with_passphrase(dir.path(), None).unwrap()); let machine = runtime .block_on(OlmMachine::with_store(alice_id(), alice_device_id(), store)) @@ -180,7 +181,7 @@ pub fn room_key_sharing(c: &mut Criterion) { }) }); let dir = tempfile::tempdir().unwrap(); - let store = Box::new(SledCryptoStore::open_with_passphrase(dir, None).unwrap()); + let store = Box::new(SledCryptoStore::open_with_passphrase(dir.path(), None).unwrap()); let machine = runtime.block_on(OlmMachine::with_store(alice_id(), alice_device_id(), store)).unwrap(); @@ -235,7 +236,7 @@ pub fn devices_missing_sessions_collecting(c: &mut Criterion) { }); let dir = tempfile::tempdir().unwrap(); - let store = Box::new(SledCryptoStore::open_with_passphrase(dir, None).unwrap()); + let store = Box::new(SledCryptoStore::open_with_passphrase(dir.path(), None).unwrap()); let machine = runtime.block_on(OlmMachine::with_store(alice_id(), alice_device_id(), store)).unwrap();