Fix bug in RstCausesPollHUP.

The test is checking the wrong poll_fd for POLLHUP. The only
reason it passed till now was because it was also checking
for POLLIN which was always true on the other fd from the
previous poll!

PiperOrigin-RevId: 270780401
This commit is contained in:
Bhasker Hariharan
2019-09-23 16:00:50 -07:00
committed by gVisor bot
parent 112736c579
commit 9846da5e65
+1 -1
View File
@@ -117,7 +117,7 @@ TEST_P(TCPSocketPairTest, RSTCausesPollHUP) {
struct pollfd poll_fd3 = {sockets->first_fd(), POLLHUP, 0};
ASSERT_THAT(RetryEINTR(poll)(&poll_fd3, 1, kPollTimeoutMs),
SyscallSucceedsWithValue(1));
ASSERT_NE(poll_fd.revents & (POLLHUP | POLLIN), 0);
ASSERT_NE(poll_fd3.revents & POLLHUP, 0);
}
// This test validates that even if a RST is sent the other end will not