Skip to content

Commit

Permalink
Added missing test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hkadayam committed Jun 21, 2024
1 parent 8a31db0 commit c444a3a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/include/homestore/index/wb_cache_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
9 changes: 5 additions & 4 deletions src/tests/test_log_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down
13 changes: 6 additions & 7 deletions src/tests/test_log_store_long_run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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,
Expand All @@ -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();
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_raft_repl_dev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */);
Expand Down

0 comments on commit c444a3a

Please sign in to comment.