Skip to content

Commit 150779e

Browse files
[3.12] pythongh-126909: Fix running xattr tests on systems with lower limits (pythonGH-126930) (python#126964)
pythongh-126909: Fix running xattr tests on systems with lower limits (pythonGH-126930) Modify the extended attribute tests to write fewer and smaller extended attributes, in order to fit within filesystems with total xattr limit of 1 KiB (e.g. ext4 with 1 KiB blocks). Previously, the test would write over 2 KiB, making it fail with ENOSPC on such systems. (cherry picked from commit 2c0a21c) Co-authored-by: Michał Górny <mgorny@gentoo.org>
1 parent 783fc3a commit 150779e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/test/test_os.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3296,10 +3296,10 @@ def _check_xattrs_str(self, s, getxattr, setxattr, removexattr, listxattr, **kwa
32963296
xattr.remove("user.test")
32973297
self.assertEqual(set(listxattr(fn)), xattr)
32983298
self.assertEqual(getxattr(fn, s("user.test2"), **kwargs), b"foo")
3299-
setxattr(fn, s("user.test"), b"a"*1024, **kwargs)
3300-
self.assertEqual(getxattr(fn, s("user.test"), **kwargs), b"a"*1024)
3299+
setxattr(fn, s("user.test"), b"a"*256, **kwargs)
3300+
self.assertEqual(getxattr(fn, s("user.test"), **kwargs), b"a"*256)
33013301
removexattr(fn, s("user.test"), **kwargs)
3302-
many = sorted("user.test{}".format(i) for i in range(100))
3302+
many = sorted("user.test{}".format(i) for i in range(32))
33033303
for thing in many:
33043304
setxattr(fn, thing, b"x", **kwargs)
33053305
self.assertEqual(set(listxattr(fn)), set(init_xattr) | set(many))

0 commit comments

Comments
 (0)