mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-16 09:52:54 +00:00
test: use guard_against_eviction from outside
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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(())) => {
|
||||
|
||||
Reference in New Issue
Block a user