Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make compiletest output truncation less disruptive #115706

Merged
merged 2 commits into from
Sep 13, 2023

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Sep 9, 2023

When the test output becomes too large, compiletest stops recording all of it. However:

  • this can lead to invalid JSON, which then causes compiletest itself to throw further errors
  • the note that output was truncated is in the middle of the output, with >100kb of text on each side; that makes it almost impossible to actually see that note in the terminal

So assuming that we do need to keep the output truncation, I propose that we only ever do a cut at the end, so that it is very clear by looking at the end of the log that truncation happened. I added a message at the beginning of the output as well. Also I added some logic to make it less likely that we'll cut things off in the middle of a JSON record. (I tested that successfully by reducing the output limit to something very low and running a few ui tests.) Furthermore I increased the max buffer size to 512KB; that's really not a lot of memory compared to how much RAM it takes to build rustc (it's ~25% more than the previous maximum HEAD+TAIL length). And finally, the information that things got truncated is now propagated to the higher levels, so that we can fail the test instead of comparing the truncated output with the reference.

Fixes #115675
Fixes #96229
Fixes #94322
Fixes #92211

@rustbot
Copy link
Collaborator

rustbot commented Sep 9, 2023

r? @wesleywiser

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Sep 9, 2023
@rust-log-analyzer

This comment has been minimized.

@wesleywiser
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 12, 2023

📌 Commit 9cf2798 has been approved by wesleywiser

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 12, 2023
@bors
Copy link
Contributor

bors commented Sep 13, 2023

⌛ Testing commit 9cf2798 with merge 8e455db...

@bors
Copy link
Contributor

bors commented Sep 13, 2023

☀️ Test successful - checks-actions
Approved by: wesleywiser
Pushing 8e455db to master...

1 similar comment
@bors
Copy link
Contributor

bors commented Sep 13, 2023

☀️ Test successful - checks-actions
Approved by: wesleywiser
Pushing 8e455db to master...

@bors bors added merged-by-bors This PR was explicitly merged by bors. labels Sep 13, 2023
@bors bors merged commit 8e455db into rust-lang:master Sep 13, 2023
12 checks passed
@rustbot rustbot added this to the 1.74.0 milestone Sep 13, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8e455db): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.3% [2.3%, 2.3%] 1
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
-1.7% [-1.7%, -1.7%] 1
All ❌✅ (primary) -3.0% [-3.0%, -3.0%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 631.641s -> 631.557s (-0.01%)
Artifact size: 317.90 MiB -> 317.99 MiB (0.03%)

@RalfJung RalfJung deleted the compiletest-truncation branch September 13, 2023 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
6 participants