Skip to content

Commit f115296

Browse files
committed
Auto merge of #2811 - saethlin:readme-nextest, r=RalfJung
Add a section on using nextest Inspired by this question: #2805
2 parents 20d95e4 + 93794b7 commit f115296

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,26 @@ degree documented below):
225225
reduced feature set. We might ship Miri with a nightly even when some features
226226
on these targets regress.
227227

228+
### Running tests in parallel
229+
230+
Though it implements Rust threading, Miri itself is a single-threaded interpreter.
231+
This means that when running `cargo miri test`, you will probably see a dramatic
232+
increase in the amount of time it takes to run your whole test suite due to the
233+
inherent interpreter slowdown and a loss of parallelism.
234+
235+
You can get your test suite's parallelism back by running `cargo miri nextest run -jN`
236+
(note that you will need [`cargo-nextest`](https://nexte.st) installed).
237+
This works because `cargo-nextest` collects a list of all tests then launches a
238+
separate `cargo miri run` for each test. You will need to specify a `-j` or `--test-threads`;
239+
by default `cargo miri nextest run` runs one test at a time. For more details, see the
240+
[`cargo-nextest` Miri documentation](https://nexte.st/book/miri.html).
241+
242+
Note: This one-test-per-process model means that `cargo miri test` is able to detect data
243+
races where two tests race on a shared resource, but `cargo miri nextest run` will not detect
244+
such races.
245+
246+
Note: `cargo-nextest` does not support doctests, see https://github.com/nextest-rs/nextest/issues/16
247+
228248
### Common Problems
229249

230250
When using the above instructions, you may encounter a number of confusing compiler

0 commit comments

Comments
 (0)