Skip to content

Commit

Permalink
Test fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Nov 18, 2024
1 parent 7760cf8 commit ae856c5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nano/core_test/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,9 @@ TEST (socket_timeout, read)

TEST (socket_timeout, write)
{
std::atomic<bool> done = false;
boost::system::error_code ec;

// create one node and set timeout to 1 second
nano::test::system system (1);
std::shared_ptr<nano::node> node = system.nodes[0];
Expand All @@ -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<nano::transport::tcp_socket> (*node, nano::transport::socket_endpoint::client); // socket with a max queue size much larger than OS buffers
std::atomic<bool> 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);

Expand Down

0 comments on commit ae856c5

Please sign in to comment.