Skip to content

Nondeterministic compiletest failure on long compiler output #53332

Open
@ashtneoi

Description

@ashtneoi

If I write a UI test that produces a lot of compiler errors, the test fails with a message like this:

running 1 test
F
failures:

---- [ui] ui/dont-commit.rs stdout ----

error: failed to decode compiler output as json: `EOF while parsing a string at line 1 column 302`
output: {"message":"snipped for brevity"}
line: {"message":"snipped for brevity"}

I can reliably trigger the bug with a UI test like this one:

fn main() {
    let e = 1;
    e = 2;
    e = 2;
    e = 2; // repeated a thousand times or so
}

However, the exact column at which the JSON parse fails is apparently nondeterministic. I ran the test multiple times under varying system load and got 237, 302, and 678. Seems like a race condition to me, although I don't know enough about compiletest to guess where the race might be.

version info

The bug is present on commit 3e05f80.

$ build/x86_64-unknown-linux-gnu/stage1/bin/rustc --version --verbose
rustc 1.30.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.30.0-dev
LLVM version: 7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-compiletestArea: The compiletest test runnerA-testsuiteArea: The testsuite used to check the correctness of rustcC-bugCategory: This is a bug.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions