From 04ab9b78feda931fc063cd3b7973c44e13572570 Mon Sep 17 00:00:00 2001 From: Joonas Koivunen Date: Tue, 22 Aug 2023 11:34:22 +0300 Subject: [PATCH] test: add more allowed outcomes I cannot see a quick fix to make one them winner, nor a reason why it should be done; at worst case there could be double accounting for some evicted layer should the two do it at the same time. --- pageserver/src/tenant/timeline.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pageserver/src/tenant/timeline.rs b/pageserver/src/tenant/timeline.rs index 253202f1a2..f308486168 100644 --- a/pageserver/src/tenant/timeline.rs +++ b/pageserver/src/tenant/timeline.rs @@ -4291,7 +4291,13 @@ mod tests { .expect("should now have a reason to download"); match (first, second) { - (Ok(()), Err(EvictionError::NotFound)) | (Err(EvictionError::NotFound), Ok(())) => {} + (Ok(()), Ok(())) => { + // because there are no more timeline locks being taken on eviction path, we can + // witness all three outcomes here. + } + (Ok(()), Err(EvictionError::NotFound)) | (Err(EvictionError::NotFound), Ok(())) => { + // if one completes before the other, this is fine just as well. + } other => unreachable!("unexpected {:?}", other), } }