about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2021-02-21 15:26:50 +0900
committerGitHub <noreply@github.com>2021-02-21 15:26:50 +0900
commitd7fb4de79172910bba6ea632196170647dcf11cb (patch)
tree4c46aed4315f5671ed006deb93874744aeef9ce9
parent01e1d2d5e842cc2ded57f65549603772278f00d6 (diff)
parent88753cead814a0830acdb527f513957fb9fe620a (diff)
downloadrust-d7fb4de79172910bba6ea632196170647dcf11cb.tar.gz
rust-d7fb4de79172910bba6ea632196170647dcf11cb.zip
Rollup merge of #82349 - tmiasko:pretty-test-timeout, r=Mark-Simulacrum
test: Print test name only once on timeout

Pretty formatter when using multiple test threads displays test name twice on
timeout event. This implicitly suggest that those are two different events,
while in fact they are always printed together.

Print test name only once.

Before:

```
running 3 tests
test src/lib.rs - c (line 16) ... ok
test src/lib.rs - a (line 3) ... ok
test src/lib.rs - b (line 9) ... test src/lib.rs - b (line 9) has been running for over 60 seconds
test src/lib.rs - b (line 9) ... ok
```

After:

```
running 3 tests
test src/lib.rs - c (line 16) ... ok
test src/lib.rs - a (line 3) ... ok
test src/lib.rs - b (line 9) has been running for over 60 seconds
test src/lib.rs - b (line 9) ... ok
```
-rw-r--r--library/test/src/formatters/pretty.rs4
1 files changed, 0 insertions, 4 deletions
diff --git a/library/test/src/formatters/pretty.rs b/library/test/src/formatters/pretty.rs
index 6fa36929841..5e41d6d9692 100644
--- a/library/test/src/formatters/pretty.rs
+++ b/library/test/src/formatters/pretty.rs
@@ -222,10 +222,6 @@ impl<T: Write> OutputFormatter for PrettyFormatter<T> {
     }
 
     fn write_timeout(&mut self, desc: &TestDesc) -> io::Result<()> {
-        if self.is_multithreaded {
-            self.write_test_name(desc)?;
-        }
-
         self.write_plain(&format!(
             "test {} has been running for over {} seconds\n",
             desc.name,