[issue11393] Integrate faulthandler module into Python 3.3
report at bugs.python.org
Wed Mar 30 01:17:25 CEST 2011
Antoine Pitrou <pitrou at free.fr> added the comment:
> - speed up the test: because dump_backtraces_later() has now a
> subsecond resolution, we can use sleep of 50 ms instead of 1 sec
This is too short, there may be random failures on some slow buildbots.
IMO, 0.5s is the minimum you can use.
+ def _check_dump_tracebacks_later(self, repeat, cancel, filename):
+ Call dump_tracebacks_later() two times, or three times if
repeat is True.
+ Check the output: the traceback may be written 1, 2 or 3 times
+ depending on repeat and cancel options.
+ Raise an error if the output doesn't match the expect format.
The docstring is outdated. It also seems the "cancel" option isn't
useful anymore, you could remove it and simplify the test.
+ process = script_helper.spawn_python('-c', code)
+ stdout, stderr = process.communicate()
Shouldn't you check the return code as well?
+ code = "\n".join(code)
Again, I think it would make the code simpler and more maintainable if
you used triple-quoted strings instead of lists/tuples.
When you launch a waiting thread in a subprocess, I think it's better to
set it in daemon mode so as to avoid blocking if the main thread raises
You have a "#ifdef MS_WINDOWS" in check_signum() but that function is
not compiled under Windows (it is inside "#ifdef FAULTHANDLER_USER").
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list