Skip to content

authctl: Fix int overflow in test on 32-bit architectures#1454

Merged
adombeck merged 1 commit intomainfrom
fix-overflow-on-32bit
Apr 15, 2026
Merged

authctl: Fix int overflow in test on 32-bit architectures#1454
adombeck merged 1 commit intomainfrom
fix-overflow-on-32bit

Conversation

@adombeck
Copy link
Copy Markdown
Contributor

@adombeck adombeck commented Apr 15, 2026

On 32-bit architectures, math.MaxInt32 + 1 is larger than the int type, so it causes the test to fail with

cmd/authctl/group/set-gid_test.go:52:65: cannot use math.MaxInt32 + 1 (untyped int constant 2147483648) as int value in argument to strconv.Itoa (overflows)

The fix is to use an int64 instead.

refs: https://bugs.launchpad.net/ubuntu/+source/authd/+bug/2148363

UDENG-9791

On 32-bit architectures, math.MaxInt32 + 1 is larger than the int type,
so it causes the test to fail with

  cmd/authctl/group/set-gid_test.go:52:65: cannot use math.MaxInt32 + 1 (untyped int constant 2147483648) as int value in argument to strconv.Itoa (overflows)

The fix is to use an int64 instead.

refs: https://bugs.launchpad.net/ubuntu/+source/authd/+bug/2148363
@adombeck adombeck marked this pull request as ready for review April 15, 2026 10:46
@adombeck adombeck requested a review from denisonbarbosa April 15, 2026 10:46
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.10%. Comparing base (15c4664) to head (2cdb432).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1454      +/-   ##
==========================================
+ Coverage   87.05%   87.10%   +0.04%     
==========================================
  Files          93       93              
  Lines        6367     6367              
  Branches      111      111              
==========================================
+ Hits         5543     5546       +3     
+ Misses        768      765       -3     
  Partials       56       56              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@adombeck adombeck merged commit a73fe9e into main Apr 15, 2026
12 of 13 checks passed
@adombeck adombeck deleted the fix-overflow-on-32bit branch April 15, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants