aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/epee_boosted_tcp_server.cpp
diff options
context:
space:
mode:
authoranon <anon [at] nowhere>2021-07-28 13:38:23 +0000
committeranon <anon [at] nowhere>2021-07-28 13:38:23 +0000
commit1510b1e55091999ab3d51fa56975df29e917f3e5 (patch)
treebc6cb941d0c6ea992abe4876b100cb3130a2b0d9 /tests/unit_tests/epee_boosted_tcp_server.cpp
parentMerge pull request #7789 (diff)
downloadmonero-1510b1e55091999ab3d51fa56975df29e917f3e5.tar.xz
unit_tests: fix broken tests
boosted_tcp_server: check condition before sleep too cryptonote_protocol_handler: each instance of BlockchainLMDB requires separate thread due to private thread local fields
Diffstat (limited to 'tests/unit_tests/epee_boosted_tcp_server.cpp')
-rw-r--r--tests/unit_tests/epee_boosted_tcp_server.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/unit_tests/epee_boosted_tcp_server.cpp b/tests/unit_tests/epee_boosted_tcp_server.cpp
index b8481bf0b..b1ed9baf7 100644
--- a/tests/unit_tests/epee_boosted_tcp_server.cpp
+++ b/tests/unit_tests/epee_boosted_tcp_server.cpp
@@ -111,8 +111,7 @@ TEST(boosted_tcp_server, worker_threads_are_exception_resistant)
{
boost::unique_lock<boost::mutex> lock(mtx);
- ASSERT_NE(boost::cv_status::timeout, cond.wait_for(lock, boost::chrono::seconds(5)));
- ASSERT_EQ(4, counter);
+ ASSERT_TRUE(cond.wait_for(lock, boost::chrono::seconds(5), [&counter]{ return counter == 4; }));
}
// Check if threads are alive
@@ -125,8 +124,7 @@ TEST(boosted_tcp_server, worker_threads_are_exception_resistant)
{
boost::unique_lock<boost::mutex> lock(mtx);
- ASSERT_NE(boost::cv_status::timeout, cond.wait_for(lock, boost::chrono::seconds(5)));
- ASSERT_EQ(4, counter);
+ ASSERT_TRUE(cond.wait_for(lock, boost::chrono::seconds(5), [&counter]{ return counter == 4; }));
}
srv.send_stop_signal();