From f0507e1db1574ff165000fa5e34b651413f37aae Mon Sep 17 00:00:00 2001 From: Zach Koopmans Date: Mon, 29 Jul 2019 16:46:28 -0700 Subject: 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 --- test/syscalls/linux/stat.cc | 5 ++--- 1 file 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. -- cgit v1.2.3