Make confirmation_solicitor.batches more robust under tsan (#2628)

This commit is contained in:
cryptocode 2020-03-05 10:19:03 +01:00 committed by GitHub
commit 31b04e24df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,11 +50,11 @@ TEST (confirmation_solicitor, batches)
ASSERT_NO_ERROR (system.poll ());
}
// From rep crawler
ASSERT_EQ (1, node2.stats.count (nano::stat::type::message, nano::stat::detail::confirm_req, nano::stat::dir::out));
system.deadline_set (5s);
solicitor.flush ();
while (node2.stats.count (nano::stat::type::message, nano::stat::detail::confirm_req, nano::stat::dir::out) < 2)
while (node2.stats.count (nano::stat::type::message, nano::stat::detail::confirm_req, nano::stat::dir::out) == 1)
{
ASSERT_NO_ERROR (system.poll ());
}
ASSERT_LE (2, node2.stats.count (nano::stat::type::message, nano::stat::detail::confirm_req, nano::stat::dir::out));
}