summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2023-09-20 14:03:23 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2023-09-20 14:03:23 -0400
commit754372aeccb74815cbb16f32ceacb04b4c5aaba9 (patch)
tree1e45694f56043a42bc342464b7096e3f3b8a58b6 /tests
parent6e30f576ca9d11d1901f4877315e97f84d15b1e1 (diff)
downloaddynamic-extension-754372aeccb74815cbb16f32ceacb04b4c5aaba9.tar.gz
Bugfixes for tiering
Fixed a few issues that manifested during the tiering tests, 1) When a version is copied, it now contains copies of the levels, not just pointers (the levels themselves still hold pointers to the shards, though). 2) Ensure that tasks are scheduled with the correct timestamp, they were originally being scheduled backwards. The get_merge_tasks() method already returns them in the correct order, so reversing them again put it in the wrong order.
Diffstat (limited to 'tests')
-rw-r--r--tests/dynamic_extension_tests.inc24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/dynamic_extension_tests.inc b/tests/dynamic_extension_tests.inc
index b9866c3..bee28f7 100644
--- a/tests/dynamic_extension_tests.inc
+++ b/tests/dynamic_extension_tests.inc
@@ -45,6 +45,25 @@ START_TEST(t_insert)
END_TEST
+START_TEST(t_debug_insert)
+{
+ auto ext_wirs = new DE(100, 2, 1);
+
+ uint64_t key = 0;
+ uint32_t val = 0;
+ for (size_t i=0; i<1000; i++) {
+ WRec r = {key, val, 1};
+ ck_assert_int_eq(ext_wirs->insert(r), 1);
+ ck_assert_int_eq(ext_wirs->get_record_count(), i+1);
+ key++;
+ val++;
+ }
+
+ delete ext_wirs;
+}
+END_TEST
+
+
START_TEST(t_insert_with_mem_merges)
{
auto ext_wirs = new DE(100, 2, 1);
@@ -329,8 +348,12 @@ START_TEST(t_static_structure)
}
size_t deletes = 0;
+ size_t t_reccnt = 0;
+ size_t k=0;
for (auto rec : records) {
+ k++;
ck_assert_int_eq(ext_wirs->insert(rec), 1);
+ t_reccnt++;
if (gsl_rng_uniform(rng) < 0.05 && !to_delete.empty()) {
std::vector<WRec> del_vec;
@@ -378,6 +401,7 @@ Suite *unit_testing()
TCase *insert = tcase_create("de::DynamicExtension<WIRS>::insert Testing");
tcase_add_test(insert, t_insert);
tcase_add_test(insert, t_insert_with_mem_merges);
+ tcase_add_test(insert, t_debug_insert);
suite_add_tcase(unit, insert);
TCase *sampling = tcase_create("de::DynamicExtension<WIRS>::range_sample Testing");