Commit deb717a0 authored by Michael Hanselmann's avatar Michael Hanselmann Committed by Iustin Pop
Browse files

Fix race condition in test for *FileID functions

In this test the “file ID” of a temporary file is compared against the
file ID gathered via an open file descriptor to the same file. For
reasons unknown to me utime(2) is called in-between to update the
inode's a- and mtime. Depending on the file system's timestamp
resolution this can lead to a different file ID.

Found by chance during QA and reproduced by adding a delay before the
call to utime(2).
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarIustin Pop <>
(cherry picked from commit fbd55434

Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarMichael Hanselmann <>
parent 839642c2
......@@ -381,7 +381,6 @@ class TestFileID(testutils.GanetiTestCase):
def testUpdate(self):
name = self._CreateTempFile()
oldi = utils.GetFileID(path=name)
os.utime(name, None)
fd =, os.O_RDWR)
newi = utils.GetFileID(fd=fd)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment