From 6d38b9ce6a9932b2f9ecf3dcc92d57e4cc8a07d5 Mon Sep 17 00:00:00 2001 From: Konstantin Knizhnik Date: Fri, 4 Jun 2021 20:11:24 +0300 Subject: [PATCH] Fix unit tests after merging --- pageserver/src/repository.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pageserver/src/repository.rs b/pageserver/src/repository.rs index 475e955bb8..693f2ff2a9 100644 --- a/pageserver/src/repository.rs +++ b/pageserver/src/repository.rs @@ -537,16 +537,17 @@ mod tests { assert_eq!(None, snapshot.next().transpose()?); // add a page and advance the last valid LSN + let rel = TESTREL_A; let buf = TEST_BUF(1); tline.put_page_image(buf, Lsn(1), TEST_IMG("blk 1 @ lsn 1"))?; tline.advance_last_valid_lsn(Lsn(1)); let mut snapshot = tline.history()?; assert_eq!(snapshot.lsn(), Lsn(1)); let expected_page = RelationUpdate { - rel: buf.rel, + rel, lsn: Lsn(1), update: Update::Page { - blknum: buf.blknum, + blknum: 1, img: TEST_IMG("blk 1 @ lsn 1"), }, }; @@ -554,7 +555,7 @@ mod tests { assert_eq!(None, snapshot.next().transpose()?); // truncate to zero, but don't advance the last valid LSN - tline.put_truncation(buf.rel, Lsn(2), 0)?; + tline.put_truncation(rel, Lsn(2), 0)?; let mut snapshot = tline.history()?; assert_eq!(snapshot.lsn(), Lsn(1)); assert_eq!(Some(&expected_page), snapshot.next().transpose()?.as_ref()); @@ -566,7 +567,7 @@ mod tests { assert_eq!(snapshot.lsn(), Lsn(2)); assert_eq!(Some(&expected_page), snapshot.next().transpose()?.as_ref()); let expected_truncate = RelationUpdate { - rel: buf.rel, + rel, lsn: Lsn(2), update: Update::Truncate { n_blocks: 0 }, };