Skip to content

Commit 28001a4

Browse files
committed
bench test handles poll error|closed properly for macos
1 parent cae619f commit 28001a4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/bench.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,13 @@ TEST_CASE("benchmark tcp::server echo server thread pool", "[benchmark]")
404404
while (true)
405405
{
406406
auto pstatus = co_await client.poll(coro::poll_op::read);
407+
if (pstatus != coro::poll_status::event)
408+
{
409+
REQUIRE_THREAD_SAFE(pstatus == coro::poll_status::closed);
410+
// the socket has been closed
411+
break;
412+
}
413+
407414
REQUIRE_THREAD_SAFE(pstatus == coro::poll_status::event);
408415

409416
auto [rstatus, rspan] = client.recv(in);
@@ -597,6 +604,13 @@ TEST_CASE("benchmark tcp::server echo server inline", "[benchmark]")
597604
while (true)
598605
{
599606
auto pstatus = co_await client.poll(coro::poll_op::read);
607+
if (pstatus != coro::poll_status::event)
608+
{
609+
REQUIRE_THREAD_SAFE(pstatus == coro::poll_status::closed);
610+
// the socket has been closed
611+
break;
612+
}
613+
600614
REQUIRE_THREAD_SAFE(pstatus == coro::poll_status::event);
601615

602616
auto [rstatus, rspan] = client.recv(in);

0 commit comments

Comments
 (0)