Skip to content

Commit

Permalink
review: adress Joonas' test comments
Browse files Browse the repository at this point in the history
  • Loading branch information
VladLazar committed Apr 18, 2024
1 parent ee25fdf commit 11a1d23
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions pageserver/src/tenant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4824,14 +4824,7 @@ mod tests {
// ```
#[tokio::test]
async fn test_get_vectored_ancestor_descent() -> anyhow::Result<()> {
let tenant_conf = TenantConf {
// Make compaction deterministic
gc_period: Duration::ZERO,
compaction_period: Duration::ZERO,
..TenantConf::default()
};

let harness = TenantHarness::create_custom("test_get_vectored_on_lsn_axis", tenant_conf)?;
let harness = TenantHarness::create("test_get_vectored_on_lsn_axis")?;
let (tenant, ctx) = harness.load().await;

let start_key = Key::from_hex("010000000033333333444444445500000000").unwrap();
Expand Down Expand Up @@ -4878,14 +4871,10 @@ mod tests {

let child_timeline_id = TimelineId::generate();

tenant
let child_timeline = tenant
.branch_timeline_test(&parent_timeline, child_timeline_id, Some(current_lsn), &ctx)
.await?;

let child_timeline = tenant
.get_timeline(child_timeline_id, true)
.expect("Should have the branched timeline");

let mut key = start_key;
while key < end_key {
if key == child_gap_at_key {
Expand Down Expand Up @@ -4915,7 +4904,10 @@ mod tests {
let mut query_lsns = Vec::new();
for image_lsn in parent_gap_lsns.keys().rev() {
for offset in lsn_offsets {
query_lsns.push(Lsn(u64::try_from(i64::try_from(image_lsn.0)? + offset)?))
query_lsns.push(Lsn(image_lsn
.0
.checked_add_signed(offset)
.expect("Shouldn't overflow")));
}
}

Expand Down

0 comments on commit 11a1d23

Please sign in to comment.