Skip to content

Commit d98a29e

Browse files
Fix cuckoocache_tests TSAN failure introduced in #14935. Fixes #14967.
1 parent 9133227 commit d98a29e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/test/checkqueue_tests.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_FrozenCleanup)
355355
// would get called twice).
356356
vChecks[0].should_freeze = true;
357357
control.Add(vChecks);
358-
BOOST_CHECK(control.Wait()); // Hangs here
358+
bool waitResult = control.Wait(); // Hangs here
359+
assert(waitResult);
359360
});
360361
{
361362
std::unique_lock<std::mutex> l(FrozenCleanupCheck::m);

src/test/cuckoocache_tests.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,10 @@ static void test_cache_erase_parallel(size_t megabytes)
220220
size_t ntodo = (n_insert/4)/3;
221221
size_t start = ntodo*x;
222222
size_t end = ntodo*(x+1);
223-
for (uint32_t i = start; i < end; ++i)
224-
BOOST_CHECK(set.contains(hashes[i], true));
223+
for (uint32_t i = start; i < end; ++i) {
224+
bool contains = set.contains(hashes[i], true);
225+
assert(contains);
226+
}
225227
});
226228

227229
/** Wait for all threads to finish

0 commit comments

Comments
 (0)