From 9051126b56c3dd8241f3bc6068c934fdee16deca Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Tue, 20 Mar 2018 21:21:26 +0100 Subject: [PATCH] test,freebsd: fix flaky poll tests On FreeBSD `close()` can fail with `ECONNRESET` if the socket was shutdown by the peer before all pending data was delivered. PR-URL: https://github.com/libuv/libuv/pull/1780 Reviewed-By: Colin Ihrig --- test/test-poll.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test-poll.c b/test/test-poll.c index e828addb..0d1b1d7e 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); }