Skip to content

Commit

Permalink
Hack compiletest to fix a random CI failure
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin committed Jan 17, 2023
1 parent 4a6d9de commit 65d1e8d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/tools/compiletest/src/read2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,18 @@ impl ProcOutput {
fn into_bytes(self) -> Vec<u8> {
match self {
ProcOutput::Full { bytes, .. } => bytes,
ProcOutput::Abbreviated { mut head, skipped, tail } => {
ProcOutput::Abbreviated { mut head, mut skipped, tail } => {
let mut tail = &*tail;

// Skip over '{' at the start of the tail, so we don't later wrongfully consider this as json.
// See <https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Weird.20CI.20failure/near/321797811>
while tail.get(0) == Some(&b'{') {
tail = &tail[1..];
skipped += 1;
}

write!(&mut head, "\n\n<<<<<< SKIPPED {} BYTES >>>>>>\n\n", skipped).unwrap();
head.extend_from_slice(&tail);
head.extend_from_slice(tail);
head
}
}
Expand Down

0 comments on commit 65d1e8d

Please sign in to comment.