summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorZach Koopmans <zkoopmans@google.com>2019-07-29 16:46:28 -0700
committergVisor bot <gvisor-bot@google.com>2019-07-29 16:47:58 -0700
commitf0507e1db1574ff165000fa5e34b651413f37aae (patch)
tree5ab5d1e9ccef86134feab06ecf64747faca7eb78
parent8e8b6096116eb490b438a53061195f737d4eca8b (diff)
Fix flaky stat.cc test.
This test flaked on my current CL. Linux makes no guarantee that two inodes will consecutive (overflows happen). https://github.com/avagin/linux-task-diag/blob/master/fs/inode.c#L880 PiperOrigin-RevId: 260608240
-rw-r--r--test/syscalls/linux/stat.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/syscalls/linux/stat.cc b/test/syscalls/linux/stat.cc
index 510f7bee5..88ab90b5b 100644
--- a/test/syscalls/linux/stat.cc
+++ b/test/syscalls/linux/stat.cc
@@ -539,9 +539,8 @@ TEST(SimpleStatTest, AnonDeviceAllocatesUniqueInodesAcrossSaveRestore) {
ASSERT_THAT(fstat(fd1.get(), &st1), SyscallSucceeds());
ASSERT_THAT(fstat(fd2.get(), &st2), SyscallSucceeds());
- // The two fds should have different inode numbers. Specifically, since fd2
- // was created later, it should have a higher inode number.
- EXPECT_GT(st2.st_ino, st1.st_ino);
+ // The two fds should have different inode numbers.
+ EXPECT_NE(st2.st_ino, st1.st_ino);
// Verify again after another S/R cycle. The inode numbers should remain the
// same.