Shorten the paths to the dummy datadirs in the unit tests
It failed CI on MacOS because of overflowing SUN_PATH_LEN.
This commit is contained in:
parent
069bca546a
commit
fe5de96312
@ -401,7 +401,7 @@ mod tests {
|
||||
let ms = DummyMinisafe::new();
|
||||
let socket_path: path::PathBuf = [
|
||||
ms.tmp_dir.as_path(),
|
||||
path::Path::new("datadir"),
|
||||
path::Path::new("d"),
|
||||
path::Path::new("bitcoin"),
|
||||
path::Path::new("minisafed_rpc"),
|
||||
]
|
||||
|
||||
@ -92,13 +92,9 @@ fn uid() -> usize {
|
||||
|
||||
pub fn tmp_dir() -> path::PathBuf {
|
||||
env::temp_dir().join(format!(
|
||||
"minisafed-unit-tests-{}-{:?}-{}-{}",
|
||||
"minisafed-{}-{:?}-{}",
|
||||
process::id(),
|
||||
thread::current().id(),
|
||||
time::SystemTime::now()
|
||||
.duration_since(time::UNIX_EPOCH)
|
||||
.unwrap()
|
||||
.subsec_nanos(),
|
||||
uid(),
|
||||
))
|
||||
}
|
||||
@ -107,9 +103,8 @@ impl DummyMinisafe {
|
||||
pub fn new() -> DummyMinisafe {
|
||||
let tmp_dir = tmp_dir();
|
||||
fs::create_dir_all(&tmp_dir).unwrap();
|
||||
let data_dir: path::PathBuf = [tmp_dir.as_path(), path::Path::new("datadir")]
|
||||
.iter()
|
||||
.collect();
|
||||
// Use a shorthand for 'datadir', to avoid overflowing SUN_LEN on MacOS.
|
||||
let data_dir: path::PathBuf = [tmp_dir.as_path(), path::Path::new("d")].iter().collect();
|
||||
|
||||
let network = bitcoin::Network::Bitcoin;
|
||||
let bitcoin_config = BitcoinConfig {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user