diff --git a/test/hill.cc b/test/hill.cc index a3152868..1b03ddf0 100644 --- a/test/hill.cc +++ b/test/hill.cc @@ -65,8 +65,10 @@ bool testcase_hill::run() { while (should_continue()) { const keygen::serial_t a_serial = serial_count; - if (unlikely(!keyvalue_maker.increment(serial_count, 1))) - failure("uphill: unexpected key-space overflow"); + if (unlikely(!keyvalue_maker.increment(serial_count, 1))) { + log_notice("uphill: unexpected key-space overflow"); + break; + } const keygen::serial_t b_serial = serial_count; assert(b_serial > a_serial); @@ -186,7 +188,7 @@ bool testcase_hill::run() { } } - while (serial_count > 0) { + while (serial_count > 1) { if (unlikely(!keyvalue_maker.increment(serial_count, -2))) failure("downhill: unexpected key-space underflow"); diff --git a/test/keygen.cc b/test/keygen.cc index 30cdf7a5..0110b049 100644 --- a/test/keygen.cc +++ b/test/keygen.cc @@ -184,7 +184,8 @@ bool maker::increment(serial_t &serial, int delta) const { } serial_t target = serial + (int64_t)delta; - if (target > mask(mapping.width)) { + if (target > mask(mapping.width) || + ((delta > 0) ? target < serial : target > serial)) { log_extra("keygen-increment: %" PRIu64 "%-d => %" PRIu64 ", overflow", serial, delta, target); return false; diff --git a/test/ttl.cc b/test/ttl.cc index 2b259ba8..b98f4a8b 100644 --- a/test/ttl.cc +++ b/test/ttl.cc @@ -132,8 +132,10 @@ bool testcase_ttl::run() { failure_perror("mdbx_put(head)", err); } - if (unlikely(!keyvalue_maker.increment(serial, 1))) - failure("uphill: unexpected key-space overflow"); + if (unlikely(!keyvalue_maker.increment(serial, 1))) { + log_notice("ttl: unexpected key-space overflow"); + goto bailout; + } } err = breakable_restart(); if (unlikely(err != MDBX_SUCCESS)) {