#29023: running tests in parallel doesn't show exception chain (even with tblib)
-------------------------------------+-------------------------------------
               Reporter:  Chris      |          Owner:  nobody
  Jerdonek                           |
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:  Testing    |        Version:  master
  framework                          |       Keywords:
               Severity:  Normal     |  
parallel,exception,chain,traceback,pickling,tblib
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Running tests in parallel doesn't show more than the first link of an
 exception chain. For example, with the following test (with `tblib`
 installed):

 {{{#!python
 def test(self):
     time.sleep(2)
     try:
         raise ValueError('foo')
     except Exception:
         raise KeyError('bar')
 }}}

 this is what the failure looks like when running tests in parallel:

 {{{
 Traceback (most recent call last):
   File "/Users/.../versions/3.6.4/lib/python3.6/unittest/case.py", line
 59, in testPartExecutor
     yield
   File "/Users/.../versions/3.6.4/lib/python3.6/unittest/case.py", line
 605, in run
     testMethod()
   File "/Users/.../myproject/myproject/tests/test_a.py", line 13, in test2
     raise KeyError('bar')
 KeyError: 'bar'
 }}}

 In contrast, this is what it looks like when running them not in parallel:

 {{{
 Traceback (most recent call last):
   File "/Users/.../myproject/myproject/tests/test_a.py", line 11, in test2
     raise ValueError('foo')
 ValueError: foo

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/Users/.../myproject/myproject/tests/test_a.py", line 13, in test2
     raise KeyError('bar')
 KeyError: 'bar'
 }}}

 Side question: why must pickling be used at all? Why can't we simply
 render the traceback to a string using Python's `traceback` module, and
 then send the string back? It seems like that would result in simpler,
 more understandable code and sidestep many of the difficulties.

 (This was reported using Python 3.6.4. and `master` as of Jan. 15, 2018:
 02365d3f38a64a5c2f3e932f23925a381d5bb151 .)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29023>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.6c19437e92d7d4ed1e996579462dd33f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to