mirror of
https://github.com/monero-project/monero.git
synced 2025-07-26 00:25:35 -04:00
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
This commit is contained in:
parent
8b63bb3c75
commit
1510b1e550
2 changed files with 8 additions and 8 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue