Skip to content

Commit

Permalink
Rollup merge of rust-lang#38013 - wezm:simplify-test-notes, r=stevekl…
Browse files Browse the repository at this point in the history
…abnik

Simplify notes on testing and concurrency

The start of the notes on tests running concurrently, added in rust-lang#37766 read a little awkwardly. This PR fixes that and simplifies the wording a bit.

r? @steveklabnik
  • Loading branch information
steveklabnik authored Dec 24, 2016
2 parents 639568c + 517fce0 commit 685027a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/doc/book/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -589,11 +589,10 @@ please see the [Documentation chapter](documentation.html).

# Testing and concurrency

One thing that is important to note when writing tests is that they may be run
concurrently using threads. For this reason you should take care that your tests
are written in such a way as to not depend on each-other, or on any shared
state. "Shared state" can also include the environment, such as the current
working directory, or environment variables.
It is important to note that tests are run concurrently using threads. For this
reason, care should be taken to ensure your tests do not depend on each-other,
or on any shared state. "Shared state" can also include the environment, such
as the current working directory, or environment variables.

If this is an issue it is possible to control this concurrency, either by
setting the environment variable `RUST_TEST_THREADS`, or by passing the argument
Expand Down

0 comments on commit 685027a

Please sign in to comment.