Skip to content

Commit

Permalink
Increase timeouts (CI is slow) and add log line for when echos time out
Browse files Browse the repository at this point in the history
  • Loading branch information
TrentHouliston committed Sep 15, 2023
1 parent 8fa71c4 commit fdf098c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/dsl/TCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ class TestReactor : public test_util::TestBase<TestReactor, 2000> {

// 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<const char*>(&timeout), sizeof(timeout));

Expand All @@ -152,7 +152,12 @@ class TestReactor : public test_util::TestBase<TestReactor, 2000> {
// Receive the echo
std::array<char, 1024> 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<Trigger<Finished>, Sync<TestReactor>>().then([this](const Finished&) {
Expand Down

0 comments on commit fdf098c

Please sign in to comment.