From fdf098c6d6c3ed3dcc398e7de48c1235cb986117 Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Sat, 16 Sep 2023 00:07:47 +1000 Subject: [PATCH] Increase timeouts (CI is slow) and add log line for when echos time out --- tests/dsl/TCP.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/dsl/TCP.cpp b/tests/dsl/TCP.cpp index 33b2502be..36b63b071 100644 --- a/tests/dsl/TCP.cpp +++ b/tests/dsl/TCP.cpp @@ -132,11 +132,11 @@ class TestReactor : public test_util::TestBase { // Set a timeout so we don't hang forever if something goes wrong #ifdef _WIN32 - DWORD timeout = 100; + DWORD timeout = 500; #else timeval timeout{}; timeout.tv_sec = 0; - timeout.tv_usec = 100000; + timeout.tv_usec = 500000; #endif ::setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, reinterpret_cast(&timeout), sizeof(timeout)); @@ -152,7 +152,12 @@ class TestReactor : public test_util::TestBase { // Receive the echo std::array buff{}; const ssize_t recv = ::recv(fd, buff.data(), socklen_t(target.name.size()), 0); - events.push_back(target.name + " echoed: " + std::string(buff.data(), recv)); + if (recv <= 1) { + events.push_back(target.name + " failed to receive echo"); + } + else { + events.push_back(target.name + " echoed: " + std::string(buff.data(), recv)); + } }); on, Sync>().then([this](const Finished&) {