Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-127933: Add option to run regression tests in parallel#128003
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This adds a new command line argument, `--parallel-threads` to theregression test runner to allow it to run individual tests in multiplethreads in parallel in order to find multithreading bugs.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Uh oh!
There was an error while loading.Please reload this page.
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.
This looks good to me. I'm a little unsure about marking tests as thread-unsafe at the source level. I worry a bit that the use ofthread_unsafe /__unittest_thread_unsafe__ will create too much noise, but I think we can see how it goes.
| barrier=threading.Barrier(self.num_threads) | ||
| threads= [] | ||
| forcase,rinzip(cases,results): | ||
| thread=threading.Thread(target=self.run_worker, |
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.
It might be nice to give these threads an informative name, something containing the testcase and the Nth thread it is.
| # Note: We can't call result.addError, result.addFailure, etc. because | ||
| # we no longer have the original exception, just the string format. | ||
| forrinresults: |
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.
This looks like something that might be worth adding tounittest.result.TestResult, something to aggregate multiple results. (Not for this PR, but it might be a nice small feature for someone to work on.)
| result.addSuccess(self) | ||
| # Note: We can't call result.addError, result.addFailure, etc. because | ||
| # we no longer have the original exception, just the string format. |
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.
FWIW, another reason not to call those is that they raise right away if failfast is set.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
| @@ -0,0 +1,3 @@ | |||
| Add an option ``--parallel-threads=N`` to the regression test runner that | |||
| runs individual tests in multiple threads in parallel in order to find | |||
| concurrency bugs. | |||
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.
Should this (or other documentation) mention that most of the testsuite isn't appropriately reviewed/marked yet?
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've updated the blurb. It might be worth adding something to the devguide when this gets further along.
Co-authored-by: T. Wouters <thomas@python.org>
Co-authored-by: T. Wouters <thomas@python.org>
This reverts commit64bf295.
e5f10a7 intopython:mainUh oh!
There was an error while loading.Please reload this page.
…ongh-128003)This adds a new command line argument, `--parallel-threads` to theregression test runner to allow it to run individual tests in multiplethreads in parallel in order to find multithreading bugs.Some tests pass when run with `--parallel-threads`, but there's stillmore work before the entire suite passes.
…ongh-128003)This adds a new command line argument, `--parallel-threads` to theregression test runner to allow it to run individual tests in multiplethreads in parallel in order to find multithreading bugs.Some tests pass when run with `--parallel-threads`, but there's stillmore work before the entire suite passes.
Uh oh!
There was an error while loading.Please reload this page.
This adds a new command line argument,
--parallel-threadsto the regression test runner to allow it to run individual tests in multiple threads in parallel in order to find multithreading bugs.Some tests pass when run with
--parallel-threads, but there's still a bunch more work before the entire suite passes:@thread_unsafesupport.gc_collect()are sensitive to threads becausegc.collect()returns immediately without running the GC if it's already running in a different thread