Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Fix cuckoocache_tests TSAN failure introduced in 14935. #14969

Merged
merged 1 commit into from Dec 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/test/checkqueue_tests.cpp
Expand Up @@ -355,7 +355,8 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_FrozenCleanup)
// would get called twice).
vChecks[0].should_freeze = true;
control.Add(vChecks);
BOOST_CHECK(control.Wait()); // Hangs here
bool waitResult = control.Wait(); // Hangs here
assert(waitResult);
});
{
std::unique_lock<std::mutex> l(FrozenCleanupCheck::m);
Expand Down
6 changes: 4 additions & 2 deletions src/test/cuckoocache_tests.cpp
Expand Up @@ -220,8 +220,10 @@ static void test_cache_erase_parallel(size_t megabytes)
size_t ntodo = (n_insert/4)/3;
size_t start = ntodo*x;
size_t end = ntodo*(x+1);
for (uint32_t i = start; i < end; ++i)
BOOST_CHECK(set.contains(hashes[i], true));
for (uint32_t i = start; i < end; ++i) {
bool contains = set.contains(hashes[i], true);
assert(contains);
}
});

/** Wait for all threads to finish
Expand Down