Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix long duration of write_to_full test case and max_io test case #533

Closed
wants to merge 13 commits into from
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.52"
version = "6.4.53"

homepage = "https://github.com/eBay/Homestore"
description = "HomeStore Storage Engine"
Expand Down
9 changes: 8 additions & 1 deletion src/tests/test_common/homestore_test_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ SISL_OPTION_GROUP(
(qdepth, "", "qdepth", "Max outstanding operations", ::cxxopts::value< uint32_t >()->default_value("8"), "number"),
(spdk, "", "spdk", "spdk", ::cxxopts::value< bool >()->default_value("false"), "true or false"),
(flip_list, "", "flip_list", "btree flip list", ::cxxopts::value< std::vector< std::string > >(), "flips [...]"),
(use_file, "", "use_file", "use file instead of real drive", ::cxxopts::value< bool >()->default_value("false"),
"true or false"),
(enable_crash, "", "enable_crash", "enable crash", ::cxxopts::value< bool >()->default_value("0"), ""));

SETTINGS_INIT(iomgrcfg::IomgrSettings, iomgr_config);
Expand Down Expand Up @@ -354,12 +356,17 @@ class HSTestHelper {
auto num_threads = SISL_OPTIONS["num_threads"].as< uint32_t >();
auto num_fibers = SISL_OPTIONS["num_fibers"].as< uint32_t >();
auto is_spdk = SISL_OPTIONS["spdk"].as< bool >();
auto use_file = SISL_OPTIONS["use_file"].as< bool >();

if (use_file && SISL_OPTIONS.count("device_list")) {
LOGWARN("Ignoring device_list as use_file is set to true");
}

if (fake_restart) {
// Fake restart, device list is unchanged.
shutdown_homestore(false);
std::this_thread::sleep_for(std::chrono::seconds{shutdown_delay_sec});
} else if (SISL_OPTIONS.count("device_list")) {
} else if (SISL_OPTIONS.count("device_list") && !use_file) {
// User has provided explicit device list, use that and initialize them
auto const devs = SISL_OPTIONS["device_list"].as< std::vector< std::string > >();
for (const auto& name : devs) {
Expand Down
5 changes: 3 additions & 2 deletions src/tests/test_meta_blk_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class VMetaBlkMgrTest : public ::testing::Test {
protected:
void SetUp() override { m_helper.start_homestore("test_meta_blk_mgr", {{HS_SERVICE::META, {.size_pct = 85.0}}}); }

void TearDown() override {};
void TearDown() override{};

public:
[[nodiscard]] uint64_t get_elapsed_time(const Clock::time_point& start) {
Expand Down Expand Up @@ -399,7 +399,7 @@ class VMetaBlkMgrTest : public ::testing::Test {
iomanager.iobuf_free(buf);
} else {
if (unaligned_addr) {
delete[] (buf - unaligned_shift);
delete[](buf - unaligned_shift);
} else {
delete[] buf;
}
Expand Down Expand Up @@ -585,6 +585,7 @@ class VMetaBlkMgrTest : public ::testing::Test {
}

void register_client() {
LOGINFO("Registering client with type: {}", mtype);
m_mbm = &(meta_service());
m_total_wrt_sz = m_mbm->used_size();
HS_REL_ASSERT_EQ(m_mbm->total_size() - m_total_wrt_sz, m_mbm->available_blks() * m_mbm->block_size());
Expand Down
9 changes: 5 additions & 4 deletions src/tests/test_scripts/log_meta_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,22 @@ def meta_nightly(options, addln_opts):
subprocess.check_call(options.dirpath + "test_meta_blk_mgr " + cmd_opts + addln_opts, stderr=subprocess.STDOUT,
shell=True)

cmd_opts = "--run_time=7200 --num_io=1000000"
cmd_opts = "--gtest_filter=VMetaBlkMgrTest.random_load_test --run_time=7200 --num_io=1000000"
subprocess.check_call(options.dirpath + "test_meta_blk_mgr " + cmd_opts + addln_opts, stderr=subprocess.STDOUT,
shell=True)

cmd_opts = "--min_write_size=65536 --max_write_size=2097152 --run_time=14400 --num_io=1000000"
cmd_opts = "--gtest_filter=VMetaBlkMgrTest.random_load_test --min_write_size=65536 --max_write_size=2097152 --run_time=14400 --num_io=1000000"
subprocess.check_call(options.dirpath + "test_meta_blk_mgr " + cmd_opts + addln_opts, stderr=subprocess.STDOUT,
shell=True)

cmd_opts = "--min_write_size=10485760 --max_write_size=80857600 --bitmap=1"
cmd_opts = "--gtest_filter=VMetaBlkMgrTest.random_load_test --min_write_size=10485760 --max_write_size=60857600 --bitmap=1"
subprocess.check_call(options.dirpath + "test_meta_blk_mgr " + cmd_opts + addln_opts, stderr=subprocess.STDOUT,
shell=True)

cmd_opts = "--gtest_filter=VMetaBlkMgrTest.write_to_full_test" # write to file instead of real disk to save time;
cmd_opts = "--gtest_filter=VMetaBlkMgrTest.random_load_test --gtest_filter=VMetaBlkMgrTest.write_to_full_test --use_file=true" # write to file instead of real disk to save time;
subprocess.check_call(options.dirpath + "test_meta_blk_mgr " + cmd_opts + addln_opts, stderr=subprocess.STDOUT,
shell=True)

print("meta blk store test completed")


Expand Down
Loading