fix: first drop mutex guard, then assert
the assert while holding the guard poisons the mutex and that causes drop to panic because of the poisoned mutex, by design; see last commit. by shortening the scope of the mutex guard we should once again see more clear build failures :)
This commit is contained in:
parent
9e695e02cb
commit
c95a9bb862
@ -38,11 +38,13 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn check_cid_subscriptions(ipfs: &Node, cid: &Cid, expected_count: usize) {
|
async fn check_cid_subscriptions(ipfs: &Node, cid: &Cid, expected_count: usize) {
|
||||||
let subs = ipfs.get_subscriptions().lock().unwrap();
|
let subscription_count = {
|
||||||
if expected_count > 0 {
|
let subs = ipfs.get_subscriptions().lock().unwrap();
|
||||||
assert_eq!(subs.len(), 1);
|
if expected_count > 0 {
|
||||||
}
|
assert_eq!(subs.len(), 1);
|
||||||
let subscription_count = subs.get(&cid.clone().into()).map(|l| l.len());
|
}
|
||||||
|
subs.get(&cid.clone().into()).map(|l| l.len())
|
||||||
|
};
|
||||||
// treat None as 0
|
// treat None as 0
|
||||||
assert_eq!(subscription_count.unwrap_or(0), expected_count);
|
assert_eq!(subscription_count.unwrap_or(0), expected_count);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user