#31509: Enable faulthandler automatically during tests
-------------------------------------+-------------------------------------
     Reporter:  Adam (Chainz)        |                    Owner:  Omkar
  Johnson                            |  Kulkarni
         Type:  New feature          |                   Status:  assigned
    Component:  Testing framework    |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Omkar Kulkarni):

 I was playing around with this locally, and the faulthandler properly
 outputs a traceback when running tests serially, but I ran into some
 issues when trying to test in parallel. I manually sent signals like
 SIGABRT or SIGSEGV to the multiprocessing PID, which caused the tests to
 loop forever (without outputting the faulthandler traceback). I believe
 this is because I am using python3.8 on macOS, which has changed the
 default start method for the multiprocessing module from 'fork' to 'spawn'
 (see https://docs.python.org/3/library/multiprocessing.html#contexts-and-
 start-methods). When I switched to python3.7, then the faulthandler will
 work for subprocesses as well (since child processes inherit signal
 handlers), but it still results in an infinite loop. I am pushing a commit
 that just enables fault handlers, but the issue of the infinite loop will
 persist since Python multiprocessing doesn't expose an API to see if the
 child is has been killed (i.e. handling SIGCHLD).

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31509#comment:5>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.7dcbd7bf58345ae9b6a898d02203eecc%40djangoproject.com.

Reply via email to