Skip to content

Commit 4152589

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 <[email protected]>
1 parent edcfb7a commit 4152589

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_os.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3478,10 +3478,10 @@ def _check_xattrs_str(self, s, getxattr, setxattr, removexattr, listxattr, **kwa
34783478
xattr.remove("user.test")
34793479
self.assertEqual(set(listxattr(fn)), xattr)
34803480
self.assertEqual(getxattr(fn, s("user.test2"), **kwargs), b"foo")
3481-
setxattr(fn, s("user.test"), b"a"*1024, **kwargs)
3482-
self.assertEqual(getxattr(fn, s("user.test"), **kwargs), b"a"*1024)
3481+
setxattr(fn, s("user.test"), b"a"*256, **kwargs)
3482+
self.assertEqual(getxattr(fn, s("user.test"), **kwargs), b"a"*256)
34833483
removexattr(fn, s("user.test"), **kwargs)
3484-
many = sorted("user.test{}".format(i) for i in range(100))
3484+
many = sorted("user.test{}".format(i) for i in range(32))
34853485
for thing in many:
34863486
setxattr(fn, thing, b"x", **kwargs)
34873487
self.assertEqual(set(listxattr(fn)), set(init_xattr) | set(many))

0 commit comments

Comments
 (0)