rust-lang / miri

An interpreter for Rust's mid-level intermediate representation
Apache License 2.0
4.18k stars 323 forks source link

Test suite takes a lot longer when I am not looking #3476

Closed RalfJung closed 3 months ago

RalfJung commented 3 months ago

Yeah I know how this sounds, but I tried it two times and it seems reproducible.^^ I am running the Miri test suite in rustc, ./x.py test miri. I then quickly switch to a different tab in my terminal emulator to do something else while the tests are running. And then somehow the first round of Miri tests takes 205.899s. But when I stay in the same tab it's only 29.842s.

The same seems to happen when I just switch from the terminal emulator to a different application.

My terminal emulator is the Gnome Terminal Version 3.51.90.

This may have something to do with ui_test's fancy output mode? Cc @oli-obk

RalfJung commented 3 months ago

How does this fancy output stuff work... is there some kind of callback to "draw next frame"? Maybe that callback simply does not get called when the terminal is in the background?

oli-obk commented 3 months ago

It's eagerly pushed information, but it sounds similar to a situation I have had before with just plain libtest tests. Doing output (like writing a single new . char), will block if the buffer is full (so if the terminal hasn't read yet).

RalfJung commented 3 months ago

True, I just had this with a ./miri check as well there a lot of output was produced and the build didn't finish until I started looking at the terminal again.

This is probably a bug in the terminal emulator then.

RalfJung commented 3 months ago

Turns out it's a bug in libvte: https://gitlab.gnome.org/GNOME/vte/-/issues/2742.