From 2c4f425a4c906079fe84dce4698efcfe18319e22 Mon Sep 17 00:00:00 2001 From: Tony Gong Date: Thu, 6 Jul 2023 09:10:42 -0700 Subject: [PATCH] Use infinite poll timeout on Fuchsia Use infinite timeout when polling on the connecting/connected socket after the listening socket is closed/shutdown on Fuchsia, as this particular poll has been observed to be very flaky in Fuchsia Infra. PiperOrigin-RevId: 546006387 --- test/syscalls/linux/socket_inet_loopback.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/syscalls/linux/socket_inet_loopback.cc b/test/syscalls/linux/socket_inet_loopback.cc index f43fe615a..10ef1e702 100644 --- a/test/syscalls/linux/socket_inet_loopback.cc +++ b/test/syscalls/linux/socket_inet_loopback.cc @@ -669,7 +669,10 @@ void TestListenHangupConnectingRead(const SocketInetTestParam& param, .fd = fd, }; // When the listening socket is closed, the peer would reset the connection. - EXPECT_THAT(poll(&pfd, 1, kTimeout), SyscallSucceedsWithValue(1)); + // NB: poll indefinitely on Fuchsia to avoid timing out in Infra. + EXPECT_THAT( + poll(&pfd, 1, GvisorPlatform() == Platform::kFuchsia ? -1 : kTimeout), + SyscallSucceedsWithValue(1)); EXPECT_EQ(pfd.revents, POLLHUP | POLLERR); char c; EXPECT_THAT(read(fd, &c, sizeof(c)), SyscallFailsWithErrno(expected_errno));