The various require() and check() methods in test_utils.hh were introduced to replace BOOST_REQUIRE() and BOOST_CHECK() respectively in multi-shard concurrent tests, specifically those in tests/boost/multishard_mutation_query_test.cc. This was done literally, just replacing BOOST_REQUIRE() with require() and BOOST_CHECK() with check(). The problem is that check() is missing a feature BOOST_CHECK() had: while BOOST_CHECK() doesn't cause an immediate test failure, just logging an error if the condition fails, it remembers this failure and will fail the test in the end. check() did not have this feature and this caused potential errors to just be logged while the test could still pass fine, causing false-positive tests passes. This patch fixes this by returning a [[nodiscard]] bool from the check() methods. The caller can & these together over all calls to check() methods and manually fail the test in the end. We choose this method over a hidden global (like BOOST_CHECK() does) for simplicity sake.
2.0 KiB
2.0 KiB