Debugging parallel nose tests?

Roy Smith roy at panix.com
Fri May 24 23:09:18 EDT 2013


In article <roy-1CC2EA.09092123052013 at news.panix.com>,
 Roy Smith <roy at panix.com> wrote:

> Is there some way to make nose print a report of how it partitioned the 
> tests across the various processes?

I never found such a feature, but I did figure out a way to do what I 
needed.  We use a system of unique id's to track HTTP requests through 
our system.  All you need do is add a X-Unique-Request-ID header and any 
of our server processes will log that.  So, I just had my test suite add:

X-Unique-Request-ID: name-of-test.process-id

to each HTTP request.  That got me what I was looking for (to know what 
tests were grouped into the same process).

> We're using:
> 
> nosetests --process-timeout=60 --processes=40 test_api.py

It turned out, the answer was purely a timing issue.  We had some tests 
that called out to facebook.  Those were (intermittently) so slow they 
caused the 60 second timeout to be exceeded.  The solution there was to 
pull the facebook tests out to their own suite (which we'll run in 
single-process mode).



More information about the Python-list mailing list