Skip to content

Commit 202c4c8

Browse files
gh-154326: Fix test_fsize_not_too_big() on Solaris (GH-154329)
Solaris silently converts resource limits that do not fit in a signed 64-bit integer to RLIM_INFINITY. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 25fea6d commit 202c4c8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Lib/test/test_resource.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ def expected(cur):
9999
# silently converted the limit value to RLIM_INFINITY.
100100
if sys.maxsize < 2**32 <= cur <= resource.RLIM_INFINITY:
101101
return [(resource.RLIM_INFINITY, max), (cur, max)]
102+
# Solaris silently converts limits that do not fit in a signed
103+
# 64-bit integer to RLIM_INFINITY.
104+
if cur >= 2**63-1:
105+
return [(resource.RLIM_INFINITY, max),
106+
(min(cur, resource.RLIM_INFINITY), max)]
102107
return [(min(cur, resource.RLIM_INFINITY), max)]
103108

104109
resource.setrlimit(resource.RLIMIT_FSIZE, (2**31-5, max))

0 commit comments

Comments
 (0)