bridge descriptors tests: Fix flaky test

This commit is contained in:
Ian Jackson 2022-11-03 11:45:32 +00:00
parent daf7eac60a
commit 70b420adf8
1 changed files with 11 additions and 1 deletions

View File

@ -315,7 +315,17 @@ async fn success() -> Result<(), anyhow::Error> {
})
.await;
mock.expect_download_calls(NFAIL - 1).await;
{
// When we cancel the download, we race with the manager.
// Maybe the download for the one we removed was started, or maybe not.
let mut mstate = mock.mstate.lock().await;
assert!(
((NFAIL - 1)..=NFAIL).contains(&mstate.download_calls),
"{:?}",
mstate.download_calls
);
mstate.download_calls = 0;
}
Ok(())
}