Skip to content

Commit

Permalink
Merge #14969: tests: Fix cuckoocache_tests TSAN failure introduced in…
Browse files Browse the repository at this point in the history
… 14935.

d98a29e Fix cuckoocache_tests TSAN failure introduced in #14935. Fixes #14967. (practicalswift)

Pull request description:

  Fix cuckoocache_tests TSAN failure introduced in #14935. Fixes #14967.

Tree-SHA512: aabbfa3ab41d9f498151a9b50a2a875fd51ed609bb54d89292114f59392aae57c85fdd5b7a04b589fbf598aaf736b425a6f62b12c806a1fa23bdd45d2d2accfb
  • Loading branch information
laanwj committed Dec 16, 2018
2 parents dba0f4c + d98a29e commit 3424171
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/test/checkqueue_tests.cpp
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 3424171

Please sign in to comment.