diff --git a/test/nested.cc b/test/nested.cc index cd197d41..1ea8be88 100644 --- a/test/nested.cc +++ b/test/nested.cc @@ -189,6 +189,26 @@ bool testcase_nested::stochastic_breakable_restart_with_nested( (flipcoin() || txn_underutilization_x256(txn_guard.get()) < 42)) should_continue &= pop_txn(); + if (flipcoin_x3()) { + unsigned period; + int err = mdbx_env_get_syncperiod(db_guard.get(), &period); + if (unlikely(err != MDBX_SUCCESS)) + failure_perror("mdbx_env_get_syncperiod()", err); + + size_t bytes; + err = mdbx_env_get_syncbytes(db_guard.get(), &bytes); + if (unlikely(err != MDBX_SUCCESS)) + failure_perror("mdbx_env_get_syncbytes()", err); + + err = mdbx_env_set_syncperiod(db_guard.get(), period ^ 42); + if (unlikely(err != MDBX_SUCCESS) && err != MDBX_BUSY) + failure_perror("mdbx_env_set_syncperiod()", err); + + err = mdbx_env_set_syncbytes(db_guard.get(), bytes ^ 42000); + if (unlikely(err != MDBX_SUCCESS) && err != MDBX_BUSY) + failure_perror("mdbx_env_set_syncbytes()", err); + } + if (should_continue) while (stack.empty() || (is_nested_txn_available() && flipcoin() && stack.size() < 5)) diff --git a/test/test.cc b/test/test.cc index d2c11d9e..380742a9 100644 --- a/test/test.cc +++ b/test/test.cc @@ -164,6 +164,14 @@ void testcase::db_open() { if (unlikely(rc != MDBX_SUCCESS)) failure_perror("mdbx_env_open()", rc); + rc = mdbx_env_set_syncperiod(db_guard.get(), unsigned(0.042 * 65536)); + if (unlikely(rc != MDBX_SUCCESS) && rc != MDBX_BUSY) + failure_perror("mdbx_env_set_syncperiod()", rc); + + rc = mdbx_env_set_syncbytes(db_guard.get(), INT_MAX / 421); + if (unlikely(rc != MDBX_SUCCESS) && rc != MDBX_BUSY) + failure_perror("mdbx_env_set_syncbytes()", rc); + log_trace("<< db_open"); }