Is it possible to use nose
to run a single test concurrently (across multiple processes) and aggregate the result in to a single pass/fail result?
We have the need to run the same test multiple times concurrently to ensure resource locking isn't being affected. If nose can't do this, is there a specific testing/design pattern to follow to achieve this?
It is possible to run tests concurrently with nose:
I've adapted the plugin to run a single test in parallel as you want. Download from http://paste.pocoo.org/show/319470/ and save as
nose/plugins/repeat.py
. Then, innose/plugins/builtin.py
, add the line('nose.plugins.repeat', 'RepeatMultiProcess'),
tobuiltins
. Call like this:Note: setup/teardown support might be broken. If so, the fix is simple, see comment in line
This seems like something you want in the test definition itself because you want to assert on the aggregation of the results. I would take a look at using multiprocessing in the test. Create a pool to execute your code in parallel. You can use a Queue to aggregate the results.