mirror of
https://github.com/python/cpython.git
synced 2025-07-23 19:25:40 +00:00
bpo-39460: Fix test_zipfile.test_add_file_after_2107() (GH-18247)
XFS filesystem is limited to 32-bit timestamp, but the utimensat() syscall doesn't fail. Moreover, there is a VFS bug which returns a cached timestamp which is different than the value on disk. https://bugzilla.redhat.com/show_bug.cgi?id=1795576 https://bugs.python.org/issue39460#msg360952
This commit is contained in:
parent
35eac4500a
commit
3cb49b62e6
1 changed files with 12 additions and 0 deletions
|
@ -616,6 +616,18 @@ class StoredTestsWithSourceFile(AbstractTestsWithSourceFile,
|
|||
except OverflowError:
|
||||
self.skipTest('Host fs cannot set timestamp to required value.')
|
||||
|
||||
mtime_ns = os.stat(TESTFN).st_mtime_ns
|
||||
if mtime_ns != (4386268800 * 10**9):
|
||||
# XFS filesystem is limited to 32-bit timestamp, but the syscall
|
||||
# didn't fail. Moreover, there is a VFS bug which returns
|
||||
# a cached timestamp which is different than the value on disk.
|
||||
#
|
||||
# Test st_mtime_ns rather than st_mtime to avoid rounding issues.
|
||||
#
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1795576
|
||||
# https://bugs.python.org/issue39460#msg360952
|
||||
self.skipTest(f"Linux VFS/XFS kernel bug detected: {mtime_ns=}")
|
||||
|
||||
with zipfile.ZipFile(TESTFN2, "w") as zipfp:
|
||||
self.assertRaises(struct.error, zipfp.write, TESTFN)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue