mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
test: memtable_test: replace BOOST_ASSERT with BOOST_REQURE
before this change, we verify the behavior of design under test using
`BOOST_ASSERT()`, which is a wrapper around `assert()`, so if a test
fails, the test just aborts. this is not very helpful for postmortem
debugging.
after this change, we use `BOOST_REQUIRE` macro for verifying the
behavior, so that Boost.Test prints out the condition if it does not
hold when we test it.
Refs #19034
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
(cherry picked from commit 2df4e9cfc2)
This commit is contained in:
@@ -1090,15 +1090,15 @@ SEASTAR_TEST_CASE(failed_flush_prevents_writes) {
|
||||
// Trigger flush
|
||||
auto f = t.flush();
|
||||
|
||||
BOOST_ASSERT(eventually_true([&] {
|
||||
BOOST_REQUIRE(eventually_true([&] {
|
||||
return db.cf_stats()->failed_memtables_flushes_count - failed_memtables_flushes_count >= 4;
|
||||
}));
|
||||
|
||||
// The flush failed, make sure there is still data in memtable.
|
||||
BOOST_ASSERT(t.min_memtable_timestamp() < api::max_timestamp);
|
||||
BOOST_REQUIRE_LT(t.min_memtable_timestamp(), api::max_timestamp);
|
||||
utils::get_local_injector().disable("table_seal_active_memtable_reacquire_write_permit");
|
||||
|
||||
BOOST_ASSERT(eventually_true([&] {
|
||||
BOOST_REQUIRE(eventually_true([&] {
|
||||
// The error above is no longer being injected, so
|
||||
// seal_active_memtable retry loop should eventually succeed
|
||||
return t.min_memtable_timestamp() == api::max_timestamp;
|
||||
|
||||
Reference in New Issue
Block a user