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
This commit is contained in:
Tony Gong
2023-07-06 09:14:24 -07:00
committed by gVisor bot
parent 82ffda8f9f
commit 2c4f425a4c
+4 -1
View File
@@ -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));