From c444a3a3c19e27e40b1412cde837a593d4f7127c Mon Sep 17 00:00:00 2001 From: Harihara Kadayam Date: Thu, 20 Jun 2024 18:27:26 -0700 Subject: [PATCH] Added missing test changes --- src/include/homestore/index/wb_cache_base.hpp | 1 - src/tests/test_log_store.cpp | 9 +++++---- src/tests/test_log_store_long_run.cpp | 13 ++++++------- src/tests/test_raft_repl_dev.cpp | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/include/homestore/index/wb_cache_base.hpp b/src/include/homestore/index/wb_cache_base.hpp index f8d7690c4..d576c2b6b 100644 --- a/src/include/homestore/index/wb_cache_base.hpp +++ b/src/include/homestore/index/wb_cache_base.hpp @@ -46,7 +46,6 @@ class IndexWBCacheBase { virtual void write_buf(const BtreeNodePtr& node, const IndexBufferPtr& buf, CPContext* context) = 0; virtual void read_buf(bnodeid_t id, BtreeNodePtr& node, node_initializer_t&& node_initializer) = 0; - virtual std::pair< bnodeid_t, uint64_t > get_root(bnodeid_t super_node_id) = 0; virtual bool get_writable_buf(const BtreeNodePtr& node, CPContext* context) = 0; diff --git a/src/tests/test_log_store.cpp b/src/tests/test_log_store.cpp index 7ed6cf2d8..d2cadd5f3 100644 --- a/src/tests/test_log_store.cpp +++ b/src/tests/test_log_store.cpp @@ -474,7 +474,8 @@ class SampleDB { for (auto& lsc : m_log_store_clients) { lsc->flush(); } - m_token.cb_ = [this, n_log_stores]() { + + m_helper.change_start_cb([this, n_log_stores]() { HS_SETTINGS_FACTORY().modifiable_settings([](auto& s) { // Disable flush and resource mgr timer in UT. s.logstore.flush_timer_frequency_us = 0; @@ -489,10 +490,10 @@ class SampleDB { .open_log_store(client->m_logdev_id, client->m_store_id, false /* append_mode */) .thenValue([i, this, client](auto log_store) { client->set_log_store(log_store); }); } - }; - test_common::HSTestHelper::restart_homestore(m_token); + }); + m_helper.restart_homestore(); } else { - m_token = test_common::HSTestHelper::start_homestore( + m_helper.start_homestore( "test_log_store", {{HS_SERVICE::META, {.size_pct = 5.0}}, {HS_SERVICE::LOG, diff --git a/src/tests/test_log_store_long_run.cpp b/src/tests/test_log_store_long_run.cpp index b2aeea160..a5e6009ba 100644 --- a/src/tests/test_log_store_long_run.cpp +++ b/src/tests/test_log_store_long_run.cpp @@ -54,7 +54,6 @@ using namespace homestore; RCU_REGISTER_INIT SISL_LOGGING_INIT(HOMESTORE_LOG_MODS) -std::vector< std::string > test_common::HSTestHelper::s_dev_names; struct test_log_data { test_log_data() = default; @@ -302,7 +301,7 @@ class LogStoreLongRun : public ::testing::Test { for (auto& lsc : m_log_store_clients) { lsc->flush(); } - m_token.cb_ = [this, n_log_stores]() { + m_helper.change_start_cb([this, n_log_stores]() { HS_SETTINGS_FACTORY().modifiable_settings([](auto& s) { // Disable flush and resource mgr timer in UT. s.logstore.flush_timer_frequency_us = 0; @@ -316,10 +315,10 @@ class LogStoreLongRun : public ::testing::Test { .open_log_store(client->m_logdev_id, client->m_store_id, false /* append_mode */) .thenValue([i, this, client](auto log_store) { client->set_log_store(log_store); }); } - }; - test_common::HSTestHelper::restart_homestore(m_token); + }); + m_helper.restart_homestore(); } else { - m_token = test_common::HSTestHelper::start_homestore( + m_helper.start_homestore( "test_log_store_long_run", {{HS_SERVICE::META, {.size_pct = 5.0}}, {HS_SERVICE::LOG, @@ -345,7 +344,7 @@ class LogStoreLongRun : public ::testing::Test { } void shutdown(bool cleanup = true) { - test_common::HSTestHelper::shutdown_homestore(cleanup); + m_helper.shutdown_homestore(cleanup); if (cleanup) { m_log_store_clients.clear(); m_highest_log_idx.clear(); @@ -560,7 +559,7 @@ class LogStoreLongRun : public ::testing::Test { uint32_t m_batch_size{1}; std::random_device rd{}; std::default_random_engine re{rd()}; - test_common::HSTestHelper::test_token m_token; + test_common::HSTestHelper m_helper; }; TEST_F(LogStoreLongRun, LongRunning) { diff --git a/src/tests/test_raft_repl_dev.cpp b/src/tests/test_raft_repl_dev.cpp index c6a326b7c..ac6aaae5c 100644 --- a/src/tests/test_raft_repl_dev.cpp +++ b/src/tests/test_raft_repl_dev.cpp @@ -676,7 +676,7 @@ TEST_F(RaftReplDevTest, GCReplReqs) { if (g_helper->replica_num() != 0) { LOGINFO("Set flip to fake fetch data request on data channel"); - set_basic_flip("drop_push_data_request"); + g_helper->set_basic_flip("drop_push_data_request"); } this->write_on_leader(100 /* num_entries */, true /* wait_for_commit */);