From ae856c5a55875cd95e4e4a181fac4af414dfe03a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Mon, 18 Nov 2024 23:14:15 +0100 Subject: [PATCH] Test fixing --- nano/core_test/socket.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nano/core_test/socket.cpp b/nano/core_test/socket.cpp index 7e045b3806..81e9e1fc84 100644 --- a/nano/core_test/socket.cpp +++ b/nano/core_test/socket.cpp @@ -564,6 +564,9 @@ TEST (socket_timeout, read) TEST (socket_timeout, write) { + std::atomic done = false; + boost::system::error_code ec; + // create one node and set timeout to 1 second nano::test::system system (1); std::shared_ptr node = system.nodes[0]; @@ -586,8 +589,7 @@ TEST (socket_timeout, write) // eventually, the all tcp queues should fill up and async_write will not be able to progress // and the timeout should kick in and close the socket, which will cause the async_write to return an error auto socket = std::make_shared (*node, nano::transport::socket_endpoint::client); // socket with a max queue size much larger than OS buffers - std::atomic done = false; - boost::system::error_code ec; + socket->async_connect (acceptor.local_endpoint (), [&socket, &ec, &done] (boost::system::error_code const & ec_a) { EXPECT_FALSE (ec_a);