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.

 * https://github.com/ipfs-rust/rust-ipfs/pull/131/checks?check_run_id=551965765#step:12:90
 * other's have already been re-run and can't easily be found
This commit is contained in:
Joonas Koivunen 2020-04-02 11:46:21 +03:00 committed by Joonas Koivunen
parent 5e3afef59c
commit 18dd8cb3ce

View File

@ -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);