summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/epoll.cc
diff options
context:
space:
mode:
authorMithun Iyer <iyerm@google.com>2020-11-09 14:52:50 -0800
committergVisor bot <gvisor-bot@google.com>2020-11-09 14:54:57 -0800
commit199fcd0fe512f2fa4af63b0ec74e36aea7c4a8e1 (patch)
treedf4a8866f0d479451039ce06adf78cbce9d04f06 /test/syscalls/linux/epoll.cc
parent2fcca60a7bf084a28e878941d9dcb47e11268cbd (diff)
Skip `EventHUp` notify in `FIN_WAIT2` on a socket close.
This Notify was added as part of cl/279106406; but notifying `EventHUp` in `FIN_WAIT2` is incorrect, as we want to only notify later on `TIME_WAIT` or a reset. However, we do need to notify any blocked waiters of an activity on the endpoint with `EventIn`|`EventOut`. PiperOrigin-RevId: 341490913
Diffstat (limited to 'test/syscalls/linux/epoll.cc')
-rw-r--r--test/syscalls/linux/epoll.cc7
1 files changed, 1 insertions, 6 deletions
diff --git a/test/syscalls/linux/epoll.cc b/test/syscalls/linux/epoll.cc
index 2101e5c9f..8a72ef10a 100644
--- a/test/syscalls/linux/epoll.cc
+++ b/test/syscalls/linux/epoll.cc
@@ -39,11 +39,6 @@ namespace {
constexpr int kFDsPerEpoll = 3;
constexpr uint64_t kMagicConstant = 0x0102030405060708;
-uint64_t ms_elapsed(const struct timespec* begin, const struct timespec* end) {
- return (end->tv_sec - begin->tv_sec) * 1000 +
- (end->tv_nsec - begin->tv_nsec) / 1000000;
-}
-
TEST(EpollTest, AllWritable) {
auto epollfd = ASSERT_NO_ERRNO_AND_VALUE(NewEpollFD());
std::vector<FileDescriptor> eventfds;
@@ -146,7 +141,7 @@ TEST(EpollTest, Timeout_NoRandomSave) {
// Check the lower bound on the timeout. Checking for an upper bound is
// fragile because Linux can overrun the timeout due to scheduling delays.
- EXPECT_GT(ms_elapsed(&begin, &end), kTimeoutMs - 1);
+ EXPECT_GT(ms_elapsed(begin, end), kTimeoutMs - 1);
}
void* writer(void* arg) {