test: use guard_against_eviction from outside

This commit is contained in:
Joonas Koivunen
2023-08-24 22:21:21 +03:00
parent 83e28083b0
commit ef1c3d3914
2 changed files with 1 additions and 14 deletions

View File

@@ -233,11 +233,6 @@ impl Layer {
pub(crate) fn local_path(&self) -> &Path {
&self.0.path
}
#[cfg(test)]
pub(crate) fn needs_download_blocking(&self) -> Result<Option<NeedsDownload>, std::io::Error> {
self.0.needs_download_blocking()
}
}
/// The download-ness ([`DownloadedLayer`]) can be either resident or wanted evicted.
@@ -995,11 +990,6 @@ impl ResidentLayer {
pub(crate) fn access_stats(&self) -> &LayerAccessStats {
self.owner.access_stats()
}
#[cfg(test)]
pub(crate) fn needs_download_blocking(&self) -> Result<Option<NeedsDownload>, std::io::Error> {
self.owner.needs_download_blocking()
}
}
impl AsLayerDesc for ResidentLayer {

View File

@@ -4245,10 +4245,7 @@ mod tests {
let (first, second) = (only_one(first), only_one(second));
batch[0]
.needs_download_blocking()
.unwrap()
.expect("should now have a reason to download");
batch[0].guard_against_eviction(false).await.unwrap_err();
match (first, second) {
(Ok(()), Ok(())) => {