From 42f80bfb924e0e93bbaee09f6120059978b715b6 Mon Sep 17 00:00:00 2001 From: zwang28 <70626450+zwang28@users.noreply.github.com> Date: Mon, 15 Jan 2024 16:30:54 +0800 Subject: [PATCH] fix(test): fix meta backup test (#14567) --- src/meta/src/backup_restore/meta_snapshot_builder.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/meta/src/backup_restore/meta_snapshot_builder.rs b/src/meta/src/backup_restore/meta_snapshot_builder.rs index 4588ca2374fb7..4d00e07452c41 100644 --- a/src/meta/src/backup_restore/meta_snapshot_builder.rs +++ b/src/meta/src/backup_restore/meta_snapshot_builder.rs @@ -90,7 +90,7 @@ impl MetaSnapshotV1Builder { .await? .into_iter() .next() - .ok_or_else(|| anyhow!("hummock version stats not found in meta store"))?; + .unwrap_or_else(HummockVersionStats::default); let compaction_groups = crate::hummock::model::CompactionGroup::list_at_snapshot::(&meta_store_snapshot) .await? @@ -193,16 +193,6 @@ mod tests { let v_ = v.clone(); async move { v_ } }; - let err = builder - .build(1, get_ckpt_builder(&hummock_version)) - .await - .unwrap_err(); - let err = assert_matches!(err, BackupError::Other(e) => e); - assert_eq!( - "hummock version stats not found in meta store", - err.to_string() - ); - let hummock_version_stats = HummockVersionStats { hummock_version_id: hummock_version.id, ..Default::default()