fix: remove use of IpfsOptions::default in tests
This has been the cause of number of test failures which happen when a
two threads are executing the IpfsOption::default at the same time.
*
* other's have already been re-run and can't easily be found
@@ -763,9 +763,11 @@ mod tests {
use libipld::ipld;
use multihash::Sha2_256;
+ const MDNS: bool = false;
+
#[async_std::test]
async fn test_put_and_get_block() {
- let options = IpfsOptions::<TestTypes>::default();
+ let options = IpfsOptions::inmemory_with_generated_keys(MDNS);
let data = b"hello block\n".to_vec().into_boxed_slice();
let cid = Cid::new_v1(Codec::Raw, Sha2_256::digest(&data));
let block = Block::new(data, cid);
@@ -782,7 +784,7 @@ mod tests {
#[async_std::test]
async fn test_put_and_get_dag() {
- let options = IpfsOptions::<TestTypes>::default();
+ let options = IpfsOptions::inmemory_with_generated_keys(MDNS);
let (ipfs, fut) = UninitializedIpfs::new(options).await.start().await.unwrap();
task::spawn(fut);
@@ -797,7 +799,7 @@ mod tests {
#[async_std::test]
async fn test_pin_and_unpin() {
- let options = IpfsOptions::<TestTypes>::default();
+ let options = IpfsOptions::inmemory_with_generated_keys(MDNS);
let (ipfs, fut) = UninitializedIpfs::new(options).await.start().await.unwrap();
task::spawn(fut);
