test: fix flaky uv_fs_lutime test (#3424)

Disable `atime` testing for symlink as this test
is dependant on a race condition on some OSes
(Linux is one) as `lstat` updates the `atime`.
As both `mtime` and `atime` are set by the same
syscall, barring an eventual kernel bug, this
test does not omit any error case.
This commit is contained in:
Momtchil Momtchev 2022-01-31 22:25:05 +01:00 committed by GitHub
parent d9e90857f0
commit e89abc80ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -851,7 +851,12 @@ static void check_utime(const char* path,
#endif
st_atim = s->st_atim.tv_sec + s->st_atim.tv_nsec / 1e9;
st_mtim = s->st_mtim.tv_sec + s->st_mtim.tv_nsec / 1e9;
ASSERT_DOUBLE_EQ(st_atim, atime);
/*
* Linux does not allow reading reliably the atime of a symlink
* since readlink() can update it
*/
if (!test_lutime)
ASSERT_DOUBLE_EQ(st_atim, atime);
ASSERT_DOUBLE_EQ(st_mtim, mtime);
}