diff options
author | Momtchil Momtchev <momtchil@momtchev.com> | 2022-01-31 22:25:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-31 16:25:05 -0500 |
commit | e89abc80ea43065a726ade191b810af53ec6158a (patch) | |
tree | 745e438a10e481d301bd0bb8e4a846979f1e8f93 | |
parent | d9e90857f0e756684f3ab3286217a68e1a0ff716 (diff) | |
download | libuv-e89abc80ea43065a726ade191b810af53ec6158a.tar.gz libuv-e89abc80ea43065a726ade191b810af53ec6158a.zip |
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.
-rw-r--r-- | test/test-fs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/test-fs.c b/test/test-fs.c index aecf10f9..c879f629 100644 --- a/test/test-fs.c +++ b/test/test-fs.c @@ -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); } |