Skip to content

Commit

Permalink
Enable raft repl UT in github build.
Browse files Browse the repository at this point in the history
  • Loading branch information
sanebay committed Aug 20, 2024
1 parent b5df323 commit 97c9746
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class HomestoreConan(ConanFile):
name = "homestore"
version = "6.4.50"
version = "6.4.51"

homepage = "https://github.com/eBay/Homestore"
description = "HomeStore Storage Engine"
Expand Down
6 changes: 3 additions & 3 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ if (${io_tests})
add_test(NAME MetaBlkMgr-Epoll COMMAND test_meta_blk_mgr)
add_test(NAME DataService-Epoll COMMAND test_data_service)

# add_test(NAME SoloReplDev-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_solo_repl_dev)
# add_test(NAME HomeRaftLogStore-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_home_raft_logstore)
# add_test(NAME RaftReplDev-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_raft_repl_dev)
# add_test(NAME SoloReplDev-Epoll COMMAND test_solo_repl_dev)
# add_test(NAME HomeRaftLogStore-Epoll COMMAND test_home_raft_logstore)
add_test(NAME RaftReplDev-Epoll COMMAND test_raft_repl_dev)
endif()

can_build_spdk_io_tests(spdk_tests)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_common/homestore_test_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ SISL_OPTION_GROUP(
"number"),
(num_devs, "", "num_devs", "number of devices to create", ::cxxopts::value< uint32_t >()->default_value("3"),
"number"),
(dev_size_mb, "", "dev_size_mb", "size of each device in MB", ::cxxopts::value< uint64_t >()->default_value("2048"),
(dev_size_mb, "", "dev_size_mb", "size of each device in MB", ::cxxopts::value< uint64_t >()->default_value("1024"),
"number"),
(device_list, "", "device_list", "Device List instead of default created",
::cxxopts::value< std::vector< std::string > >(), "path [...]"),
Expand Down
11 changes: 8 additions & 3 deletions src/tests/test_raft_repl_dev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ class TestReplicatedDB : public homestore::ReplDevListener {
Value v{
.lsn_ = lsn, .data_size_ = jheader->data_size, .data_pattern_ = jheader->data_pattern, .blkid_ = blkids};

LOGINFOMOD(replication, "[Replica={}] Received commit on lsn={} dsn={} key={} value[blkid={} pattern={}]",
g_helper->replica_num(), lsn, ctx->dsn(), k.id_, v.blkid_.to_string(), v.data_pattern_);
LOGINFO("[Replica={}] Received commit on lsn={} dsn={} key={} value[blkid={} pattern={}]",
g_helper->replica_num(), lsn, ctx->dsn(), k.id_, v.blkid_.to_string(), v.data_pattern_);

{
std::unique_lock lk(db_mtx_);
Expand Down Expand Up @@ -288,6 +288,9 @@ class TestReplicatedDB : public homestore::ReplDevListener {
req->jheader.data_pattern = ((long long)rand() << 32) | ++s_uniq_num;
auto block_size = SISL_OPTIONS["block_size"].as< uint32_t >();

LOGINFO("[Replica={}] Db write key={} data_size={} pattern={} block_size={}", g_helper->replica_num(),
req->key_id, data_size, req->jheader.data_pattern, block_size);

if (data_size != 0) {
req->write_sgs =
test_common::HSTestHelper::create_sgs(data_size, max_size_per_iov, req->jheader.data_pattern);
Expand Down Expand Up @@ -491,7 +494,7 @@ class RaftReplDevTest : public testing::Test {

LOGINFO("Run on worker threads to schedule append on repldev for {} Bytes.", block_size);
g_helper->runner().set_task([this, block_size, db]() {
static std::normal_distribution<> num_blks_gen{128.0, 0.0};
static std::normal_distribution<> num_blks_gen{3.0, 2.0};
this->generate_writes(std::abs(std::round(num_blks_gen(g_re))) * block_size, block_size, db);
});
if (wait_for_commit) { g_helper->runner().execute().get(); }
Expand Down Expand Up @@ -765,6 +768,7 @@ TEST_F(RaftReplDevTest, Snapshot_and_Compact) {
g_helper->sync_for_cleanup_start();
}

#if 0
TEST_F(RaftReplDevTest, RemoveReplDev) {
LOGINFO("Homestore replica={} setup completed", g_helper->replica_num());

Expand Down Expand Up @@ -815,6 +819,7 @@ TEST_F(RaftReplDevTest, RemoveReplDev) {
// see if records are being removed
g_helper->sync_for_cleanup_start();
}
#endif

#ifdef _PRERELEASE
// Garbage collect the replication requests
Expand Down

0 comments on commit 97c9746

Please sign in to comment.