Reduce Rust test debug info in CI to prevent OOM - #1580
Conversation
8680521 to
77e852c
Compare
77e852c to
c57f423
Compare
There was a problem hiding this comment.
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.
XCFramework BuildThis PR's XCFramework is available for testing. Add to your .package(url: "https://github.com/automattic/wordpress-rs", branch: "pr-build/1580")Built from c57f423 |
AliSoftware
left a comment
There was a problem hiding this comment.
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.
|
|
||
| ### Fixed | ||
|
|
||
| - **Internal:** Use line-table-only debug info for Rust tests to prevent OOM-induced Buildkite agent loss while retaining file/line backtraces. |
There was a problem hiding this comment.
The changelog entry should have gone into the Unreleased section.
| # 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 |
There was a problem hiding this comment.
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. 😕
There was a problem hiding this comment.
Updated in #1581. I'm waiting for the CI result and will request a review afterwards.
* 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]`
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
Test plan
make -n test-rust-lib test-rust-docChangelog
## [Unreleased].