From d9042017fbe2c92afe8e11c83c521f2f50f21533 Mon Sep 17 00:00:00 2001 From: bsbds <69835502+bsbds@users.noreply.github.com> Date: Mon, 27 May 2024 23:24:12 +0800 Subject: [PATCH] fix(xline): commit revision change in tests Signed-off-by: bsbds <69835502+bsbds@users.noreply.github.com> --- crates/xline/src/storage/compact/revision_compactor.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/xline/src/storage/compact/revision_compactor.rs b/crates/xline/src/storage/compact/revision_compactor.rs index 49d52daa5..cd6619a3b 100644 --- a/crates/xline/src/storage/compact/revision_compactor.rs +++ b/crates/xline/src/storage/compact/revision_compactor.rs @@ -135,11 +135,14 @@ mod test { // auto_compactor works successfully assert_eq!(revision_compactor.do_compact(None).await, Some(10)); revision_gen_state.next(); // current revision: 111 + revision_gen_state.commit(); assert_eq!(revision_compactor.do_compact(Some(10)).await, Some(11)); revision_compactor.pause(); revision_gen_state.next(); // current revision 112 + revision_gen_state.commit(); assert!(revision_compactor.do_compact(Some(11)).await.is_none()); revision_gen_state.next(); // current revision 113 + revision_gen_state.commit(); assert!(revision_compactor.do_compact(Some(11)).await.is_none()); revision_compactor.resume(); assert_eq!(revision_compactor.do_compact(Some(11)).await, Some(13));