diff --git a/test/uvw/fs_req.cpp b/test/uvw/fs_req.cpp index 2cc127ea..c67f324b 100644 --- a/test/uvw/fs_req.cpp +++ b/test/uvw/fs_req.cpp @@ -783,10 +783,14 @@ TEST(FsReq, ReadDir) { checkFsCloseDirEvent = true; }); - fsReq->on>([&checkFsReadDirEvent](const auto &, auto &hndl) { + fsReq->on>([&checkFsReadDirEvent](const auto &event, auto &hndl) { ASSERT_FALSE(checkFsReadDirEvent); - checkFsReadDirEvent = true; - hndl.closedir(); + if (!event.eos) { + hndl.readdir(); + } else { + checkFsReadDirEvent = true; + hndl.closedir(); + } }); fsReq->on>([&checkFsOpenDirEvent](const auto &, auto &hndl) {