Skip to content

Commit 2dbf59c

Browse files
committed
f: use /dev/shm if available
1 parent 7cc7dcc commit 2dbf59c

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

fuzz/src/fs_store.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ struct TempFilesystemStore {
1313

1414
impl TempFilesystemStore {
1515
fn new() -> Self {
16-
let mut temp_path = std::env::temp_dir();
16+
const SHM_PATH: &str = "/dev/shm";
17+
let mut temp_path = if std::path::Path::new(SHM_PATH).exists() {
18+
std::path::PathBuf::from(SHM_PATH)
19+
} else {
20+
std::env::temp_dir()
21+
};
22+
1723
let random_folder_name = format!("fs_store_fuzz_{}", Uuid::new_v4());
1824
temp_path.push(random_folder_name);
1925

@@ -121,13 +127,8 @@ async fn do_test_internal<Out: test_logger::Output>(data: &[u8], _out: Out) {
121127
},
122128
// Async remove
123129
10 | 11 => {
124-
let fut = KVStore::remove(
125-
fs_store,
126-
primary_namespace,
127-
secondary_namespace,
128-
key,
129-
v == 10,
130-
);
130+
let fut =
131+
KVStore::remove(fs_store, primary_namespace, secondary_namespace, key, v == 10);
131132

132133
// Already set the current_data, even though writing hasn't finished yet. This supports the call-time
133134
// ordering semantics.

0 commit comments

Comments
 (0)