Skip to content

Reduce Rust test debug info in CI to prevent OOM - #1580

Merged
iangmaia merged 1 commit into
trunkfrom
iangmaia/cap-rust-test-memory
Aug 19, 2026
Merged

Reduce Rust test debug info in CI to prevent OOM#1580
iangmaia merged 1 commit into
trunkfrom
iangmaia/cap-rust-test-memory

Conversation

@iangmaia

@iangmaia iangmaia commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Fixes AINFRA-2938

Description

We've noticed some builds cause the CI agent to be lost, who kept running for long without being terminated.

This PR aims to prevent OOM-related Buildkite agent loss without reducing Rust test concurrency.

Changes

  • Use line-table-only debug info for Rust library and doc tests (also made the job duration to fall from ~8m to ~5m40s).

Test plan

Changelog

  • Added an entry under ## [Unreleased].

@iangmaia iangmaia self-assigned this Aug 19, 2026
@iangmaia
iangmaia force-pushed the iangmaia/cap-rust-test-memory branch 4 times, most recently from 8680521 to 77e852c Compare August 19, 2026 11:32
@iangmaia
iangmaia force-pushed the iangmaia/cap-rust-test-memory branch from 77e852c to c57f423 Compare August 19, 2026 11:39
@iangmaia iangmaia changed the title Limit Rust test compilation concurrency Reduce Rust test debug info in CI Aug 19, 2026
@iangmaia iangmaia changed the title Reduce Rust test debug info in CI Reduce Rust test debug info in CI to prevent OOM Aug 19, 2026
@iangmaia
iangmaia requested a balanced review from Copilot August 19, 2026 11:56
@iangmaia
iangmaia marked this pull request as ready for review August 19, 2026 11:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Reduces CI memory usage for Rust library and documentation tests while preserving file/line backtraces.

Changes:

  • Configures test debug info as line-tables-only.
  • Documents the CI reliability fix in the changelog.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Makefile Applies reduced debug info to Rust library and doc tests.
CHANGELOG.md Records the OOM mitigation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@wpmobilebot

Copy link
Copy Markdown
Collaborator

XCFramework Build

This PR's XCFramework is available for testing. Add to your Package.swift:

.package(url: "https://github.com/automattic/wordpress-rs", branch: "pr-build/1580")

Built from c57f423

@iangmaia
iangmaia requested review from a team August 19, 2026 12:01

@AliSoftware AliSoftware left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This feels like a worth change to try to check if it will indeed reduce OOMs significantly. And to my understanding should have limited impact to the debuggability of the compiled library, so seems worth a tradeoff to make.

@iangmaia
iangmaia merged commit a68ebeb into trunk Aug 19, 2026
37 checks passed
@iangmaia
iangmaia deleted the iangmaia/cap-rust-test-memory branch August 19, 2026 18:21
Comment thread CHANGELOG.md

### Fixed

- **Internal:** Use line-table-only debug info for Rust tests to prevent OOM-induced Buildkite agent loss while retaining file/line backtraces.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The changelog entry should have gone into the Unreleased section.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixed in #1581.

Comment thread Makefile
Comment on lines +227 to +232
# Line tables preserve file/line backtraces without full debug info's CI memory cost.
test-rust-lib:
$(rust_docker_run) cargo test --lib -- --nocapture
$(rust_docker_run) env CARGO_PROFILE_TEST_DEBUG=line-tables-only cargo test --lib -- --nocapture

test-rust-doc:
$(rust_docker_run) cargo test --doc -- --nocapture
$(rust_docker_run) env CARGO_PROFILE_TEST_DEBUG=line-tables-only cargo test --doc -- --nocapture

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think this covers the entire CI run, so we probably needed it to be part of root Cargo.toml file:

 [profile.test]
 debug = "line-tables-only"

I was looking into the implications of that seeing that since we were also pinged for review, but the PR got merged already. 😕

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Updated in #1581. I'm waiting for the CI result and will request a review afterwards.

oguzkocer added a commit that referenced this pull request Aug 20, 2026
* Revert "Reduce Rust test debug info in CI (#1580)"

This reverts commit a68ebeb.

Reverted so the setting can be reapplied as `[profile.test]` in the workspace
`Cargo.toml`, where it also reaches the `cargo test` invocations the two
patched `Makefile` targets missed.

* Move the Rust test debuginfo setting into `[profile.test]`

Reapply the CI memory cap as a workspace profile rather than an environment
variable on two `Makefile` targets. As a profile it reaches every `cargo test`
invocation — the four others in the `Makefile` and direct `cargo test` runs
outside it — and it applies to the whole dependency graph, not only the crate
under test.

Changes:
- Add `[profile.test] debug = "line-tables-only"` to the workspace `Cargo.toml`
- Add the changelog entry under `## [Unreleased]`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants