diff --git a/test/test-poll.c b/test/test-poll.c index e828addbb..0d1b1d7ec 100644 --- a/test/test-poll.c +++ b/test/test-poll.c @@ -134,7 +134,10 @@ static void close_socket(uv_os_sock_t sock) { #else r = close(sock); #endif - ASSERT(r == 0); + /* On FreeBSD close() can fail with ECONNRESET if the socket was shutdown by + * the peer before all pending data was delivered. + */ + ASSERT(r == 0 || errno == ECONNRESET); }