-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed as not planned
Labels
A-doctestsArea: rustdoc --testArea: rustdoc --testC-bugCategory: bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Description
Problem
Both cargo test and cargo test --doc use around (1 + n) GB of memory during doc-test linking, where n is the number of doc-tests. This behaviour can be seen here:
2024-07-04.19-59-38.copy.mp4
The code in question is https://github.com/rpm-rs/rpmspec-rs (master branch or commit 1e57d1d)
Steps
git clone https://github.com/rpm-rs/rpmspec-rs --depth 1
cd rpmspec-rs
cargo test #--doc
Try removing one of the doc-tests. On my machine, for every doc-test I remove, the memory usage drops by 1 GB.
Possible Solution(s)
No response
Notes
Things I have already tried
cargo clean, problem persists- Use another linker, but Doc-tests do not respect linker settings #14189
- Changing doc-tests to normal
#[test]s, memory issue disappears entirely
Extra notes
Notice the memory usage comes from ld (see the video above). However, this only happens with doc-tests; this never happens under cargo check, cargo build and normal tests (i.e. cargo test excluding doc-tests).
Version
cargo 1.79.0 (ffa9cf99a 2024-06-03)
release: 1.79.0
commit-hash: ffa9cf99a594e59032757403d4c780b46dc2c43a
commit-date: 2024-06-03
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.3 vendored)
libcurl: 8.6.0-DEV (sys:0.4.72+curl-8.6.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w 11 Sep 2023
os: Ultramarine Linux 40.0.0 (lostumbrella) [64-bit]
Metadata
Metadata
Assignees
Labels
A-doctestsArea: rustdoc --testArea: rustdoc --testC-bugCategory: bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.