summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/aio.cc
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2020-04-09 16:40:12 -0700
committergVisor bot <gvisor-bot@google.com>2020-04-09 16:41:27 -0700
commit9f87502b4619b60779ce19c41ea0e6bd6582e8e4 (patch)
tree4005d090dab8dfc8401d097265754bec0d2869d9 /test/syscalls/linux/aio.cc
parentace90f823cf33d1c1180dcd0d2061c702270a0d6 (diff)
Remove TODOs from Async IO
Block and drain requests in io_destroy(2). Note the reason to create read-only mapping. PiperOrigin-RevId: 305786312
Diffstat (limited to 'test/syscalls/linux/aio.cc')
-rw-r--r--test/syscalls/linux/aio.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/syscalls/linux/aio.cc b/test/syscalls/linux/aio.cc
index a33daff17..806d5729e 100644
--- a/test/syscalls/linux/aio.cc
+++ b/test/syscalls/linux/aio.cc
@@ -89,6 +89,7 @@ class AIOTest : public FileTest {
FileTest::TearDown();
if (ctx_ != 0) {
ASSERT_THAT(DestroyContext(), SyscallSucceeds());
+ ctx_ = 0;
}
}
@@ -188,14 +189,19 @@ TEST_F(AIOTest, BadWrite) {
}
TEST_F(AIOTest, ExitWithPendingIo) {
- // Setup a context that is 5 entries deep.
- ASSERT_THAT(SetupContext(5), SyscallSucceeds());
+ // Setup a context that is 100 entries deep.
+ ASSERT_THAT(SetupContext(100), SyscallSucceeds());
struct iocb cb = CreateCallback();
struct iocb* cbs[] = {&cb};
// Submit a request but don't complete it to make it pending.
- EXPECT_THAT(Submit(1, cbs), SyscallSucceeds());
+ for (int i = 0; i < 100; ++i) {
+ EXPECT_THAT(Submit(1, cbs), SyscallSucceeds());
+ }
+
+ ASSERT_THAT(DestroyContext(), SyscallSucceeds());
+ ctx_ = 0;
}
int Submitter(void* arg) {