Skip to content

fix(ci): add swap to Linux unit test runners - #22780

Merged
mikehardy merged 1 commit into
ankidroid:mainfrom
criticalAY:ci/unit-test-linux-swap-22766
Oct 26, 2026
Merged

mikehardy merged 1 commit into
ankidroid:mainfrom
criticalAY:ci/unit-test-linux-swap-22766

Conversation

@criticalAY

Copy link
Copy Markdown
Contributor

Note

Assisted-by: Opus 5.5

Purpose / Description

The Ubuntu unit test jobs run out of memory. They fill the 16 GB of RAM and the runner's 3 GB swap file, then slow down until a test times out or the job is killed. Windows already gets a pagefile, so this gives Linux 8 GB of extra swap.

Fixes

Approach

Adds a step that creates and enables an 8 GB swap file on Linux runners.

How Has This Been Tested?

All runs on my fork, three Ubuntu jobs each, with memory logged every 30s:

Learning (optional, can help others)

The Linux runners already have a 3 GB swap file, it just isn't enough for the unit tests.

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

The Ubuntu unit test jobs fill their 16 GB of RAM and the runner's
3 GB swap file, then slow down until tests time out or the job is
killed. Add 8 GB of swap on Linux, as Windows already gets a pagefile.

Fixes 22766

Assisted-by: Claude Opus 5.5

@david-allison david-allison left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, cheers

A comment would be useful.

Merge at will if there's no movement in 24 hours

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Oct 26, 2026

@mikehardy mikehardy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Man, Kotlin+JDK+Android is RAM hungry.

@mikehardy
mikehardy added this pull request to the merge queue Oct 26, 2026
@mikehardy mikehardy added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge labels Oct 26, 2026
Merged via the queue into ankidroid:main with commit 6b2dfdc Oct 26, 2026
25 checks passed
@github-actions github-actions Bot added this to the 2.26 release milestone Oct 26, 2026
@github-actions github-actions Bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Oct 26, 2026
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.

Unit tests: Timeout

3 participants