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
This commit is contained in:
Zach Koopmans 2019-07-29 16:46:28 -07:00 committed by gVisor bot
parent 8e8b609611
commit f0507e1db1
1 changed files with 2 additions and 3 deletions

View File

@ -539,9 +539,8 @@ TEST(SimpleStatTest, AnonDeviceAllocatesUniqueInodesAcrossSaveRestore) {
ASSERT_THAT(fstat(fd1.get(), &st1), SyscallSucceeds()); ASSERT_THAT(fstat(fd1.get(), &st1), SyscallSucceeds());
ASSERT_THAT(fstat(fd2.get(), &st2), SyscallSucceeds()); ASSERT_THAT(fstat(fd2.get(), &st2), SyscallSucceeds());
// The two fds should have different inode numbers. Specifically, since fd2 // The two fds should have different inode numbers.
// was created later, it should have a higher inode number. EXPECT_NE(st2.st_ino, st1.st_ino);
EXPECT_GT(st2.st_ino, st1.st_ino);
// Verify again after another S/R cycle. The inode numbers should remain the // Verify again after another S/R cycle. The inode numbers should remain the
// same. // same.