Skip to content
Snippets Groups Projects
Commit 0bec671d authored by Daniel Salzman's avatar Daniel Salzman
Browse files

Merge branch 'test_page64k' into 'master'

test/journal: enable 64k (and other weird) page size

See merge request !1339
parents 767833d3 8644e030
No related branches found
No related tags found
1 merge request!1339test/journal: enable 64k (and other weird) page size
Pipeline #86427 passed
......@@ -44,6 +44,16 @@ zone_journal_t jj;
unsigned env_flag;
static unsigned lmdb_page_size(knot_lmdb_db_t *db)
{
knot_lmdb_txn_t txn = { 0 };
knot_lmdb_begin(db, &txn, false);
MDB_stat st = { 0 };
mdb_stat(txn.txn, txn.db->dbi, &st);
knot_lmdb_abort(&txn);
return st.ms_psize;
}
static void set_conf(int zonefile_sync, size_t journal_usage, const knot_dname_t *apex)
{
(void)apex;
......@@ -708,7 +718,7 @@ static void test_merge(const knot_dname_t *apex)
list_t l;
// allow merge
set_conf(-1, 100 * 1024, apex);
set_conf(-1, 400 * 1024, apex);
ok(!journal_allow_flush(jj), "journal: merge allowed");
ret = journal_scrape_with_md(jj, false);
......@@ -761,7 +771,7 @@ static void test_merge(const knot_dname_t *apex)
// now fill up with dumy changesets to enforce merge
tm_chs(apex, -1);
while (changeset_to(tm_chs(apex, 0)) != 2) { }
for (i = 0; i < 400; i++) {
for (i = 0; i < 1600; i++) {
ret = journal_insert(jj, tm_chs(apex, i), NULL);
assert(ret == KNOT_EOK);
}
......@@ -853,7 +863,9 @@ int main(int argc, char *argv[])
test_store_load(apex);
test_size_control(apex, apex2);
if (lmdb_page_size(&jdb) == 4096) {
test_size_control(apex, apex2);
} // else it is not manually optimized enough to test correctly
test_merge(apex);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment