From 34f63b473c82d0dc1a802e602db23835abce17fb Mon Sep 17 00:00:00 2001 From: CalvinNeo Date: Fri, 5 Jan 2024 20:13:29 +0800 Subject: [PATCH] z Signed-off-by: CalvinNeo --- .../mock_store/mock_fast_add_peer_impls.rs | 2 +- proxy_tests/proxy/shared/fast_add_peer.rs | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/proxy_components/mock-engine-store/src/mock_store/mock_fast_add_peer_impls.rs b/proxy_components/mock-engine-store/src/mock_store/mock_fast_add_peer_impls.rs index a1bccd51b89..cd754746241 100644 --- a/proxy_components/mock-engine-store/src/mock_store/mock_fast_add_peer_impls.rs +++ b/proxy_components/mock-engine-store/src/mock_store/mock_fast_add_peer_impls.rs @@ -41,7 +41,7 @@ pub(crate) unsafe extern "C" fn ffi_apply_fap_snapshot( "region_id" => region_id, "peer_id" => peer_id, ); - if assert_exist { + if assert_exist != 0 { panic!("should exist region_id={} peed_id={}", region_id, peer_id); } return 0; diff --git a/proxy_tests/proxy/shared/fast_add_peer.rs b/proxy_tests/proxy/shared/fast_add_peer.rs index 37e9ff8a77a..99c5e18e4a7 100644 --- a/proxy_tests/proxy/shared/fast_add_peer.rs +++ b/proxy_tests/proxy/shared/fast_add_peer.rs @@ -24,7 +24,7 @@ enum PauseType { fn basic_fast_add_peer() { tikv_util::set_panic_hook(true, "./"); let (mut cluster, pd_client) = new_mock_cluster(0, 2); - fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap(); + fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap(); cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true; // fail::cfg("on_pre_write_apply_state", "return").unwrap(); fail::cfg("fap_mock_fake_snapshot", "return(1)").unwrap(); @@ -67,7 +67,7 @@ fn test_overlap_last_apply_old() { let (mut cluster, pd_client) = new_mock_cluster_snap(0, 3); pd_client.disable_default_operator(); disable_auto_gen_compact_log(&mut cluster); - fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap(); + fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap(); cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true; tikv_util::set_panic_hook(true, "./"); // Can always apply snapshot immediately @@ -198,7 +198,7 @@ fn test_overlap_apply_legacy_in_the_middle() { let (mut cluster, pd_client) = new_mock_cluster_snap(0, 3); pd_client.disable_default_operator(); disable_auto_gen_compact_log(&mut cluster); - fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap(); + fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap(); cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true; cluster.cfg.tikv.raft_store.store_batch_system.pool_size = 4; cluster.cfg.tikv.raft_store.apply_batch_system.pool_size = 4; @@ -350,7 +350,7 @@ fn simple_fast_add_peer( // The case in TiFlash is (DelayedPeer, false, Build) tikv_util::set_panic_hook(true, "./"); let (mut cluster, pd_client) = new_mock_cluster(0, 3); - fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap(); + fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap(); cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true; if !check_timeout { fail::cfg("fap_core_fallback_millis", "return(1000000)").unwrap(); @@ -766,7 +766,7 @@ fn test_existing_peer() { tikv_util::set_panic_hook(true, "./"); let (mut cluster, pd_client) = new_mock_cluster(0, 2); - fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap(); + fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap(); cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true; // fail::cfg("on_pre_write_apply_state", "return").unwrap(); disable_auto_gen_compact_log(&mut cluster); @@ -815,7 +815,7 @@ fn test_existing_peer() { fn test_apply_snapshot() { tikv_util::set_panic_hook(true, "./"); let (mut cluster, pd_client) = new_mock_cluster(0, 3); - fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap(); + fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap(); cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true; // fail::cfg("on_pre_write_apply_state", "return").unwrap(); disable_auto_gen_compact_log(&mut cluster); @@ -895,7 +895,7 @@ fn test_apply_snapshot() { fn test_split_no_fast_add() { let (mut cluster, pd_client) = new_mock_cluster_snap(0, 3); pd_client.disable_default_operator(); - fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap(); + fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap(); cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true; tikv_util::set_panic_hook(true, "./"); @@ -938,7 +938,7 @@ fn test_split_no_fast_add() { fn test_split_merge() { let (mut cluster, pd_client) = new_mock_cluster_snap(0, 3); pd_client.disable_default_operator(); - fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap(); + fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap(); cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true; tikv_util::set_panic_hook(true, "./"); @@ -991,7 +991,7 @@ fn test_split_merge() { fn test_fall_back_to_slow_path() { let (mut cluster, pd_client) = new_mock_cluster_snap(0, 2); pd_client.disable_default_operator(); - fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap(); + fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap(); cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true; tikv_util::set_panic_hook(true, "./"); @@ -1030,7 +1030,7 @@ fn test_fall_back_to_slow_path() { fn test_single_replica_migrate() { let (mut cluster, pd_client) = new_mock_cluster_snap(0, 3); pd_client.disable_default_operator(); - fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap(); + fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap(); cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true; tikv_util::set_panic_hook(true, "./");