-
Notifications
You must be signed in to change notification settings - Fork 3
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 "how it works" and "caveats" sections to readme #24
Conversation
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 @ngoldbaum, good idea! A few minor comments, and CI isn't happy yet.
README.rst
Outdated
Given an existing test, this plugin creates a new test that is equivalent to | ||
the following: | ||
|
||
```python |
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.
CI is unhappy because this is a .rst
file, not .md
.
README.rst
Outdated
|
||
|
||
with ThreadPoolExecutor(max_workers=num_parallel_threads) as tpe: | ||
b = threading.Barrer(num_parallel_threads) |
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.
typo here, Barrier
README.rst
Outdated
@@ -49,6 +48,31 @@ Features | |||
* ``num_iterations``: The number of iterations the test will run in each | |||
thread | |||
|
|||
Explanation |
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.
I think I'd call this slightly differently (maybe "How it works"), and move it above Features
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.
Good improvement. I left a couple of comments.
README.rst
Outdated
b.wait() | ||
for _ in range(num_iterations): |
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.
Waiting for the barrier happens in every iteration.
b.wait() | |
for _ in range(num_iterations): | |
for _ in range(num_iterations): | |
b.wait() |
README.rst
Outdated
``` | ||
|
||
Using this plugin avoids the boilerplate of rewriting existing tests to run in | ||
parallel in a thread pool. |
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.
Maybe add a note about trying our best to do proper error propagation as well?
6e7ccad
to
70fd18b
Compare
I also added a |
70fd18b
to
4383814
Compare
README.rst
Outdated
import threading | ||
from concurrent.futures import ThreadPoolExecutor | ||
|
||
def run_test(b): |
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.
Maybe declare *args
and **kwargs
to explicitly indicate that fixtures are shared across concurrent test instances?
@ngoldbaum, is this one ready? |
I think so! OK to merge? |
I think adding the code example makes it a bit more explicitly clear what exactly the plugin is doing.