Skip to content

Commit

Permalink
Auto merge of #115706 - RalfJung:compiletest-truncation, r=wesleywiser
Browse files Browse the repository at this point in the history
Make compiletest output truncation less disruptive

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 rust-lang/rust#115675
Fixes rust-lang/rust#96229
Fixes rust-lang/rust#94322
Fixes rust-lang/rust#92211
  • Loading branch information
bors committed Sep 13, 2023
2 parents e5478a1 + 5bd73a3 commit 3a488aa
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 3a488aa

Please sign in to comment.