Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test): use unqiue dir during test #1434

Merged
merged 1 commit into from
Mar 12, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sn_networking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ bls = { package = "blsttc", version = "8.0.1" }
libp2p-identity = { version = "0.2.7", features = ["rand"] }
quickcheck = "1.0.3"
eyre = "0.6.8"
uuid = { version = "1.5.0", features = ["v4"] }

[lints]
workspace = true
Expand Down
7 changes: 6 additions & 1 deletion sn_networking/src/record_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ impl NodeRecordStore {
})
.count();

debug!("Relevant records len is {:?}", relevant_records_len);
debug!("Relevant records len is {relevant_records_len:?}");
relevant_records_len
}

Expand Down Expand Up @@ -945,9 +945,14 @@ mod tests {
async fn get_records_within_distance_range() -> eyre::Result<()> {
let max_records = 50;

let temp_dir = std::env::temp_dir();
let unique_dir_name = uuid::Uuid::new_v4().to_string();
let storage_dir = temp_dir.join(unique_dir_name);

// setup the store
let store_config = NodeRecordStoreConfig {
max_records,
storage_dir,
..Default::default()
};
let self_id = PeerId::random();
Expand Down