-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sections about testing concurrency and stdout/err capture #37766
Add sections about testing concurrency and stdout/err capture #37766
Conversation
…chapter of the book.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! Needs one minor change.
|
||
One thing that is important to note when writing tests are run concurrently | ||
using threads (by default the number of threads is equal to the number of CPUs | ||
on the machine). For this reason you should take care that your tests are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove this? It's not exactly true ish, and it's not something we guarantee.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The concurrency/threading in testing bit? I understand that it may be platform dependant, but I think it's important to point this out or you can spend some time debugging race conditions in your tests. Can you suggest a more accurate version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the parenthetical about CPU counts, sorry 😄 i should have been more specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, makes sense. Done :)
@bors: r+ rollup thank you! |
📌 Commit 5a76fe4 has been approved by |
…ure, r=steveklabnik Add sections about testing concurrency and stdout/err capture
…ure, r=steveklabnik Add sections about testing concurrency and stdout/err capture
|
||
# Testing and concurrency | ||
|
||
One thing that is important to note when writing tests are run concurrently |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You seem to be missing something in this sentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will fix.
…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
No description provided.