Skip to content

Commit 197c0b3

Browse files
committed
Test that adding an epoll to an epoll doesn't immediately wake the outer epoll
PiperOrigin-RevId: 831194471
1 parent 5703c1a commit 197c0b3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/syscalls/linux/epoll.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,13 @@ TEST(EpollTest, DoubleLayerEpoll) {
631631
ASSERT_NO_ERRNO(RegisterEpollFD(epfd2.get(), epfd1.get(), EPOLLIN | EPOLLHUP,
632632
epfd1.get()));
633633

634+
// Verify that there are no events initially.
635+
struct epoll_event ret_events[2];
636+
ASSERT_THAT(RetryEINTR(epoll_wait)(epfd2.get(), ret_events, 2, 0),
637+
SyscallSucceedsWithValue(0));
638+
ASSERT_THAT(RetryEINTR(epoll_wait)(epfd1.get(), ret_events, 2, 0),
639+
SyscallSucceedsWithValue(0));
640+
634641
// Write to wfd and then check if epoll events were generated correctly.
635642
// Run this loop a couple of times to check if event in epfd1 is cleaned.
636643
constexpr char data[] = "data";

0 commit comments

Comments
 (0)