From 0cbd5f37406d14fcfbd41592053389de42e1d330 Mon Sep 17 00:00:00 2001 From: haojinming Date: Wed, 4 Jan 2023 13:48:05 +0800 Subject: [PATCH] fix test case Signed-off-by: haojinming --- tests/failpoint_tests.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/failpoint_tests.rs b/tests/failpoint_tests.rs index 52b0905..ebb2582 100644 --- a/tests/failpoint_tests.rs +++ b/tests/failpoint_tests.rs @@ -198,7 +198,6 @@ async fn txn_cleanup_range_async_commit_locks() -> Result<()> { init().await?; let scenario = FailScenario::setup(); - info!(logger, "test range clean lock"); fail::cfg("after-prewrite", "return").unwrap(); defer! { @@ -226,6 +225,15 @@ async fn txn_cleanup_range_async_commit_locks() -> Result<()> { assert_eq!(res.meet_locks, keys.len() - 3); + // cleanup all locks to avoid affecting following cases. + let options = ResolveLocksOptions { + async_commit_only: false, + ..Default::default() + }; + client.cleanup_locks(&safepoint, options).await?; + must_committed(&client, keys).await; + assert_eq!(count_locks(&client).await?, 0); + scenario.teardown(); Ok(()) }