[TSAN] Fix off-by-one in socket.drop_policy test (#2786)

Causing access of the counted_completion mutex after it goes out of
scope.
This commit is contained in:
Guilherme Lawless 2020-05-26 11:07:35 +01:00 committed by GitHub
commit 658c5e3cc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,7 @@ TEST (socket, drop_policy)
});
auto client (std::make_shared<nano::socket> (node, boost::none, nano::socket::concurrency::multi_writer));
nano::util::counted_completion write_completion (total_message_count - 1);
nano::util::counted_completion write_completion (total_message_count);
client->async_connect (boost::asio::ip::tcp::endpoint (boost::asio::ip::address_v4::loopback (), server_port),
[client, total_message_count, node, &write_completion, &drop_policy](boost::system::error_code const & ec_a) {