Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up`cargo test` doesn't capture print from threads #42474
Comments
Mark-Simulacrum
referenced this issue
Jun 6, 2017
Closed
`cargo test` doesn't capture print from threads #4129
Mark-Simulacrum
added
the
T-libs
label
Jun 6, 2017
This comment has been minimized.
This comment has been minimized.
|
|
Mark-Simulacrum
added
A-libtest
C-feature-request
labels
Jul 27, 2017
This comment has been minimized.
This comment has been minimized.
|
In my tests, I use |
dtolnay
added
C-feature-accepted
and removed
C-feature-request
labels
Nov 19, 2017
This comment has been minimized.
This comment has been minimized.
|
I would be interested in seeing a fix for this in a PR. |
This comment has been minimized.
This comment has been minimized.
|
It'd be nice if there were some way to ask the current test "what print sink are you using?" so that it can pass them down to any spawned threads. That would at least work for "manual" threads. It wouldn't work for things like Rayon (AFAIK). |
kpcyrd commentedJun 6, 2017
I've filed this bug in rust-lang/cargo but I'm afraid rust-lang/rust is the correct repo for this.
I ran the tests for one of my crates that uses threads in its example code. I've noticed it printed some lines to stdout, even though
--nocapturewasn't set, but not all of them. It appears that text printed from new threads are not correctly captured, I think this is not intended.Reproduce
Output
Meta
rustc --version --verbose: