diff --git a/test/nested.cc b/test/nested.cc index 45ffbc47..d90eae90 100644 --- a/test/nested.cc +++ b/test/nested.cc @@ -209,7 +209,10 @@ retry: if (unlikely(!keyvalue_maker.increment(serial, 1))) { log_notice("nested: unexpected key-space overflow"); - return false; + keyspace_overflow = true; + head_count = n; + stochastic_breakable_restart_with_nested(true); + goto retry; } } @@ -278,8 +281,8 @@ bool testcase_nested::run() { return false; } - if (should_continue() || !clear_wholetable_passed || - !clear_stepbystep_passed) { + if (!keyspace_overflow && (should_continue() || !clear_wholetable_passed || + !clear_stepbystep_passed)) { unsigned underutilization_x256 = txn_underutilization_x256(txn_guard.get()); if (dbfull_passed > underutilization_x256) { diff --git a/test/test.h b/test/test.h index 2399ee58..f9afb450 100644 --- a/test/test.h +++ b/test/test.h @@ -301,6 +301,7 @@ class testcase_nested : public testcase { unsigned clear_wholetable_passed{0}; unsigned clear_stepbystep_passed{0}; unsigned dbfull_passed{0}; + bool keyspace_overflow{false}; FIFO fifo; std::stack> stack; diff --git a/test/ttl.cc b/test/ttl.cc index 428a90c2..d095c9f6 100644 --- a/test/ttl.cc +++ b/test/ttl.cc @@ -81,6 +81,7 @@ bool testcase_ttl::run() { unsigned clear_stepbystep_passed = 0; unsigned dbfull_passed = 0; unsigned loops = 0; + bool keyspace_overflow = false; while (true) { const uint64_t salt = prng64_white(seed) /* mdbx_txn_id(txn_guard.get()) */; @@ -134,8 +135,8 @@ bool testcase_ttl::run() { return false; } - if (should_continue() || !clear_wholetable_passed || - !clear_stepbystep_passed) { + if (!keyspace_overflow && (should_continue() || !clear_wholetable_passed || + !clear_stepbystep_passed)) { unsigned underutilization_x256 = txn_underutilization_x256(txn_guard.get()); if (dbfull_passed > underutilization_x256) { @@ -165,7 +166,11 @@ bool testcase_ttl::run() { if (unlikely(!keyvalue_maker.increment(serial, 1))) { log_notice("ttl: unexpected key-space overflow"); - goto bailout; + keyspace_overflow = true; + txn_restart(true, false); + serial = fifo.front().first; + fifo.front().second = head_count = n; + goto retry; } } err = breakable_restart();