From 6e91a22d80e0b6fbb44cdab62d7396d5c57216c9 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 16 Dec 2018 12:11:19 +0100 Subject: [PATCH] Merge #14969: tests: Fix cuckoocache_tests TSAN failure introduced in 14935. d98a29ec408590e54f405a7f8d232cd9dc5b14da 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 --- src/test/checkqueue_tests.cpp | 3 ++- src/test/cuckoocache_tests.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/test/checkqueue_tests.cpp b/src/test/checkqueue_tests.cpp index 31cef7ad1b..fd4d8ddfe3 100644 --- a/src/test/checkqueue_tests.cpp +++ b/src/test/checkqueue_tests.cpp @@ -333,7 +333,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 l(FrozenCleanupCheck::m); diff --git a/src/test/cuckoocache_tests.cpp b/src/test/cuckoocache_tests.cpp index 74a7a63581..4a204a5e35 100644 --- a/src/test/cuckoocache_tests.cpp +++ b/src/test/cuckoocache_tests.cpp @@ -226,8 +226,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