-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustc
Description
Running a ui
test will eventually invoke the following function:
rust/src/tools/compiletest/src/read2.rs
Lines 48 to 57 in 4ca19e0
fn into_bytes(self) -> Vec<u8> { | |
match self { | |
ProcOutput::Full(bytes) => bytes, | |
ProcOutput::Abbreviated { mut head, skipped, tail } => { | |
write!(&mut head, "\n\n<<<<<< SKIPPED {} BYTES >>>>>>\n\n", skipped).unwrap(); | |
head.extend_from_slice(&tail); | |
head | |
} | |
} | |
} |
through
rust/src/tools/compiletest/src/runtest.rs
Lines 1772 to 1780 in 4ca19e0
let Output { status, stdout, stderr } = | |
read2_abbreviated(child).expect("failed to read output"); | |
let result = ProcRes { | |
status, | |
stdout: String::from_utf8_lossy(&stdout).into_owned(), | |
stderr: String::from_utf8_lossy(&stderr).into_owned(), | |
cmdline, | |
}; |
which can truncate a long output from the compiler. The problem is that UI tests ask the compiler to output its output as json and then attempts to parse it later, for example here:
rust/src/tools/compiletest/src/runtest.rs
Line 3114 in 4ca19e0
let rustfix_input = json::rustfix_diagnostics_only(&proc_res.stderr); |
which can fail due to truncation and output very difficult to investigate output in e.g. CI.
Metadata
Metadata
Assignees
Labels
A-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustc