Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ bindgen = "0.72.0"
[dev-dependencies]
glob = "0.3.0"
gpt = "3.0.0"
once_cell = "1.19.0"
serde = { version = "1.0.130", features = ["derive"] }
serde_json = "1.0.68"
tempfile = "3.4.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/util/mod.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
use libc::fallocate;
use once_cell::sync::Lazy;
use serde::{Deserialize, Deserializer};
use std::{
fs::OpenOptions,
io,
os::unix::io::AsRawFd,
path::Path,
process::Command,
sync::LazyLock,
sync::{Arc, Mutex, MutexGuard},
};

use tempfile::{NamedTempFile, TempPath};

// All tests use the same loopback device interface and so can tread on each others toes leading to
// racy tests. So we need to lock all tests to ensure only one runs at a time.
static LOCK: Lazy<Arc<Mutex<()>>> = Lazy::new(|| Arc::new(Mutex::new(())));
static LOCK: LazyLock<Arc<Mutex<()>>> = LazyLock::new(|| Arc::new(Mutex::new(())));

pub fn create_backing_file(size: i64) -> TempPath {
let file = NamedTempFile::new().expect("should be able to create a temp file");
Expand Down
Loading