Skip to content

Commit

Permalink
Shorten long running overall time
Browse files Browse the repository at this point in the history
  • Loading branch information
shosseinimotlagh committed Feb 7, 2024
1 parent 78901af commit 7edb38a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 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,7 +231,7 @@ 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);
LOGINFO("Step 2: Do remove one by one for {} iterations", num_entries);
for (uint32_t i{0}; i < num_iters; ++i) {
this->remove_one(vec[i]);
}
Expand Down
3 changes: 1 addition & 2 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,7 +250,7 @@ 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);
LOGINFO("Step 2: Do remove one by one for {} iterations", num_entries);
for (uint32_t i{0}; i < num_iters; ++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

0 comments on commit 7edb38a

Please sign in to comment.