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

Shorten long running overall time #309

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/tests/test_index_btree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ TYPED_TEST(BtreeTest, SequentialRemove) {
TYPED_TEST(BtreeTest, RandomRemove) {
// Forward sequential insert
const auto num_entries = SISL_OPTIONS["num_entries"].as< uint32_t >();
const auto num_iters = SISL_OPTIONS["num_iters"].as< uint32_t >();

LOGINFO("Step 1: Do forward sequential insert for {} entries", num_entries);
for (uint32_t i{0}; i < num_entries; ++i) {
Expand All @@ -232,8 +231,8 @@ TYPED_TEST(BtreeTest, RandomRemove) {

// shuffle keys in [0, num_entries)
std::random_shuffle(vec.begin(), vec.end());
LOGINFO("Step 2: Do remove one by one for {} iterations", num_iters);
for (uint32_t i{0}; i < num_iters; ++i) {
LOGINFO("Step 2: Do remove one by one for {} entries", num_entries);
for (uint32_t i{0}; i < num_entries; ++i) {
this->remove_one(vec[i]);
}
this->get_all();
Expand Down
5 changes: 2 additions & 3 deletions src/tests/test_mem_btree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ TYPED_TEST(BtreeTest, SimpleRemoveRange) {
TYPED_TEST(BtreeTest, RandomRemove) {
// Forward sequential insert
const auto num_entries = SISL_OPTIONS["num_entries"].as< uint32_t >();
const auto num_iters = SISL_OPTIONS["num_iters"].as< uint32_t >();

LOGINFO("Step 1: Do forward sequential insert for {} entries", num_entries);
for (uint32_t i{0}; i < num_entries; ++i) {
Expand All @@ -251,8 +250,8 @@ TYPED_TEST(BtreeTest, RandomRemove) {

// shuffle keys in [0, num_entries)
std::random_shuffle(vec.begin(), vec.end());
LOGINFO("Step 2: Do remove one by one for {} iterations", num_iters);
for (uint32_t i{0}; i < num_iters; ++i) {
LOGINFO("Step 2: Do remove one by one for {} entries", num_entries);
for (uint32_t i{0}; i < num_entries; ++i) {
this->remove_one(vec[i]);
}

Expand Down
7 changes: 4 additions & 3 deletions src/tests/test_scripts/btree_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
preload_size = " --preload_size=262144" # 256K
num_entries = " --num_entries=2097152" # 2M
num_iters = " --num_iters=100000000"
run_time = " --run_time=36000"
run_time = " --run_time=14400" # 4 hours
dev_list = ""

for opt, arg in opts:
Expand Down Expand Up @@ -100,10 +100,10 @@ def function_crash(runtime, cleanup_after_shutdown=False, init_device=False, typ
subprocess.check_call(dirpath + "test_index_btree " + cmd_opts, stderr=subprocess.STDOUT, shell=True)

def long_running_clean_shutdown(type=0):
normal_run_time = 1 * 3600 # 1 hour
normal_run_time = 1 * 1200 # 20 minutes
try:
function_normal(normal_run_time, False, True, type)
for i in range(1,8):
for i in range(1,3):
function_normal(normal_run_time, False, False, type)
print("Iteration {} completed successfully".format(i))
function_normal(0, True, False, type) # cleanup after shutdown
Expand Down Expand Up @@ -139,6 +139,7 @@ def test_index_btree():
#TODO enable for other types when fix is available for varlen node types.
for type in range(4):
long_running_clean_shutdown(type)
print("long_running_clean_shutdown completed successfully for type {}".format(type))
except:
print("Test failed: {}".format(e))
break
Expand Down
Loading