Skip to content

Commit

Permalink
better logging assert message
Browse files Browse the repository at this point in the history
  • Loading branch information
yamingk committed Sep 27, 2023
1 parent ca6a450 commit 62a30a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tests/test_blk_read_tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ TEST_F(BlkReadTrackerTest, TestThreadedInsertWaitonThenRemove) {
std::thread t([this, &bids, i, &mtx, &called]() {
get_inst()->wait_on(bids[i], [i, &bids, &mtx, &called]() {
std::unique_lock lk(mtx);
assert(!called[i]); // callback shouldn't be called more than once;
LOGMSG_ASSERT(called[i] == false, "not expecting callback to be called more than once!");
called[i] = true;
LOGINFO("wait_on called on blkid: {};", bids[i].to_string());
});
Expand All @@ -427,8 +427,8 @@ TEST_F(BlkReadTrackerTest, TestThreadedInsertWaitonThenRemove) {

LOGINFO("Step 4: all threads joined.");

for (const auto x : called) {
assert(x); // all callbacks should be called;
for (auto i = 0ul; i < called.size(); ++i) {
LOGMSG_ASSERT(called[i] == true, "expecting all waiters to be called");
}

LOGINFO("Step 5: all bids wait_on cb called.");
Expand Down

0 comments on commit 62a30a3

Please sign in to comment.